API: Remove ability to set visuals on windows
authorBenjamin Otte <otte@redhat.com>
Thu, 6 Oct 2016 14:02:39 +0000 (16:02 +0200)
committerBenjamin Otte <otte@redhat.com>
Sun, 16 Oct 2016 16:17:21 +0000 (18:17 +0200)
And with it, gtk_widget_get_visual() and gtk_widget_set_visual() are
gone.

We now always use the RGBA visual (if available) and otherwise fall back
to the system visual.

44 files changed:
demos/gtk-demo/offscreen_window.c
demos/gtk-demo/offscreen_window2.c
gdk/gdkwindow.c
gdk/gdkwindow.h
gdk/wayland/gdkdevice-wayland.c
gdk/wayland/gdkdnd-wayland.c
gdk/win32/gdkwindow-win32.c
gdk/x11/gdkdnd-x11.c
gtk/deprecated/Makefile.inc
gtk/deprecated/gtkhandlebox.c [deleted file]
gtk/deprecated/gtkhandlebox.h [deleted file]
gtk/deprecated/gtkmisc.c
gtk/gtk.h
gtk/gtkdnd.c
gtk/gtkdrawingarea.c
gtk/gtkeventbox.c
gtk/gtkfixed.c
gtk/gtkiconview.c
gtk/gtklayout.c
gtk/gtkmenu.c
gtk/gtkmenushell.c
gtk/gtknotebook.c
gtk/gtkoffscreenwindow.c
gtk/gtkoverlay.c
gtk/gtkpaned.c
gtk/gtkpopover.c
gtk/gtkrevealer.c
gtk/gtkscrolledwindow.c
gtk/gtkseparatortoolitem.c
gtk/gtkspinbutton.c
gtk/gtkstack.c
gtk/gtktextview.c
gtk/gtktoolitemgroup.c
gtk/gtktoolpalette.c
gtk/gtktreeview.c
gtk/gtktreeviewcolumn.c
gtk/gtkviewport.c
gtk/gtkwidget.c
gtk/gtkwidget.h
gtk/gtkwindow.c
gtk/inspector/inspect-button.c
tests/gtkoffscreenbox.c
tests/subsurface.c
tests/testgtk.c

index acd4c419013b9a2c727daa8f7b692bc205eb2f85..20f0b6c4f30df4d7e014573918f2707dea422a46 100644 (file)
@@ -255,10 +255,9 @@ gtk_rotated_bin_realize (GtkWidget *widget)
                         | GDK_ENTER_NOTIFY_MASK
                         | GDK_LEAVE_NOTIFY_MASK;
 
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.wclass = GDK_INPUT_OUTPUT;
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
index a9d1687087b71124f4000522528911b988502660..9d96500613c266af9acee28a69168abefb0027f4 100644 (file)
@@ -194,10 +194,9 @@ gtk_mirror_bin_realize (GtkWidget *widget)
                         | GDK_ENTER_NOTIFY_MASK
                         | GDK_LEAVE_NOTIFY_MASK;
 
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.wclass = GDK_INPUT_OUTPUT;
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
index a7201816c6329d15cbd109b6f8607365d2498987..ba64a65f43256e06de9c7da7ccb1bd6175d69d67 100644 (file)
@@ -1340,11 +1340,6 @@ gdk_window_new (GdkWindow     *parent,
       return NULL;
     }
 
-  if (attributes_mask & GDK_WA_VISUAL)
-    {
-      g_return_val_if_fail (gdk_visual_get_screen (attributes->visual) == screen, NULL);
-    }
-
   display = gdk_screen_get_display (screen);
 
   window = _gdk_display_create_window (display);
@@ -1418,9 +1413,8 @@ gdk_window_new (GdkWindow     *parent,
       return NULL;
     }
 
-  if (attributes_mask & GDK_WA_VISUAL)
-    window->visual = attributes->visual;
-  else
+  window->visual = gdk_screen_get_rgba_visual (screen);
+  if (window->visual == NULL)
     window->visual = gdk_screen_get_system_visual (screen);
 
   window->event_mask = attributes->event_mask;
index 319d8367c2ada876af17a3a0842bac9aeb04319f..d3b3240dffad6bddb92eaba35dfbc5fc12629c97 100644 (file)
@@ -91,7 +91,6 @@ typedef enum
  * @GDK_WA_TITLE: Honor the title field
  * @GDK_WA_X: Honor the X coordinate field
  * @GDK_WA_Y: Honor the Y coordinate field
- * @GDK_WA_VISUAL: Honor the visual field
  * @GDK_WA_NOREDIR: Honor the override_redirect field
  * @GDK_WA_TYPE_HINT: Honor the type_hint field
  *
@@ -107,9 +106,8 @@ typedef enum
   GDK_WA_TITLE    = 1 << 1,
   GDK_WA_X        = 1 << 2,
   GDK_WA_Y        = 1 << 3,
-  GDK_WA_VISUAL           = 1 << 4,
-  GDK_WA_NOREDIR   = 1 << 5,
-  GDK_WA_TYPE_HINT = 1 << 6
+  GDK_WA_NOREDIR   = 1 << 4,
+  GDK_WA_TYPE_HINT = 1 << 5
 } GdkWindowAttributesType;
 
 /* Size restriction enumeration.
@@ -352,7 +350,6 @@ struct _GdkWindowAttr
   gint width;
   gint height;
   GdkWindowWindowClass wclass;
-  GdkVisual *visual;
   GdkWindowType window_type;
   gboolean override_redirect;
   GdkWindowTypeHint type_hint;
index fd396767401c5944c42e70f55a604d2773d0e496..f453df5b4d849267432739264841ee45203e708e 100644 (file)
@@ -4512,9 +4512,8 @@ create_foreign_dnd_window (GdkDisplay *display)
   attrs.width = attrs.height = 1;
   attrs.wclass = GDK_INPUT_OUTPUT;
   attrs.window_type = GDK_WINDOW_TEMP;
-  attrs.visual = gdk_screen_get_system_visual (screen);
 
-  mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  mask = GDK_WA_X | GDK_WA_Y;
 
   return gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
 }
index adc33a4bc27ebcd911dd3f9d5381fdeb7ce93043..817b72e15fa4cfcb796d8a84ce8c90dcbc2dc87b 100644 (file)
@@ -508,9 +508,8 @@ create_dnd_window (GdkScreen *screen)
   attrs.wclass = GDK_INPUT_OUTPUT;
   attrs.window_type = GDK_WINDOW_TEMP;
   attrs.type_hint = GDK_WINDOW_TYPE_HINT_DND;
-  attrs.visual = gdk_screen_get_system_visual (screen);
 
-  mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_TYPE_HINT;
+  mask = GDK_WA_X | GDK_WA_Y | GDK_WA_TYPE_HINT;
 
   return gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
 }
index 6a5a7dca68bf19b7af83fe7eaab1fa5f644eba9e..0adb9074b13e18c239919859d6260f2a4a264ee8 100644 (file)
@@ -672,7 +672,6 @@ RegisterGdkClass (GdkWindowType wtype, GdkWindowTypeHint wtype_hint)
  * except for toplevel window where OS/Window Manager placement
  * is used.
  *
- * The visual parameter, is based on GDK_WA_VISUAL if set already.
  * From attributes the only things used is: colormap, title,
  * wmclass and type_hint. [1]. We are checking redundant information
  * and complain if that changes, which would break this implementation
@@ -734,9 +733,9 @@ _gdk_win32_display_create_window_impl (GdkDisplay    *display,
       remaining_mask &= ~GDK_WA_NOREDIR;
     }
 
-  if ((remaining_mask & ~(GDK_WA_VISUAL|GDK_WA_TITLE|GDK_WA_TYPE_HINT)) != 0)
+  if ((remaining_mask & ~(GDK_WA_TITLE|GDK_WA_TYPE_HINT)) != 0)
     g_warning ("_gdk_window_impl_new: uexpected attribute 0x%X",
-               remaining_mask & ~(GDK_WA_VISUAL|GDK_WA_TITLE|GDK_WA_TYPE_HINT));
+               remaining_mask & ~(GDK_WA_TITLE|GDK_WA_TYPE_HINT));
 
   hparent = GDK_WINDOW_HWND (real_parent);
 
@@ -744,10 +743,6 @@ _gdk_win32_display_create_window_impl (GdkDisplay    *display,
   impl->wrapper = GDK_WINDOW (window);
   window->impl = GDK_WINDOW_IMPL (impl);
 
-  if (attributes_mask & GDK_WA_VISUAL)
-    g_assert ((gdk_screen_get_system_visual (screen) == attributes->visual) ||
-              (gdk_screen_get_rgba_visual (screen) == attributes->visual));
-
   impl->override_redirect = override_redirect;
   impl->layered = FALSE;
   impl->layered_opacity = 1.0;
index bb322c4c10fc06b8b15a41a72cc67d5b7560e8d1..16685510fdf322a323ee0cace761ffc326d74c81 100644 (file)
@@ -2001,11 +2001,8 @@ create_drag_window (GdkScreen *screen)
   attrs.wclass = GDK_INPUT_OUTPUT;
   attrs.window_type = GDK_WINDOW_TEMP;
   attrs.type_hint = GDK_WINDOW_TYPE_HINT_DND;
-  attrs.visual = gdk_screen_get_rgba_visual (screen);
-  if (!attrs.visual)
-    attrs.visual = gdk_screen_get_system_visual (screen);
 
-  mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_TYPE_HINT;
+  mask = GDK_WA_X | GDK_WA_Y | GDK_WA_TYPE_HINT;
 
   return gdk_window_new (gdk_screen_get_root_window (screen), &attrs, mask);
 }
index 45039387f49b412c3fd352d75117818515c6a717..e93bd66a58ab48dbcac05f1d1c5616f7b2d6d2ca 100644 (file)
@@ -8,7 +8,6 @@ deprecated_h_sources =                  \
        deprecated/gtkcolorseldialog.h  \
        deprecated/gtkfontsel.h         \
        deprecated/gtkgradient.h        \
-       deprecated/gtkhandlebox.h       \
        deprecated/gtkhbbox.h           \
        deprecated/gtkhpaned.h          \
        deprecated/gtkhscale.h          \
@@ -52,7 +51,6 @@ deprecated_c_sources =                        \
        deprecated/gtkcolorseldialog.c  \
        deprecated/gtkfontsel.c         \
        deprecated/gtkgradient.c        \
-       deprecated/gtkhandlebox.c       \
        deprecated/gtkhbbox.c           \
        deprecated/gtkhpaned.c          \
        deprecated/gtkhscale.c          \
diff --git a/gtk/deprecated/gtkhandlebox.c b/gtk/deprecated/gtkhandlebox.c
deleted file mode 100644 (file)
index cb1d12c..0000000
+++ /dev/null
@@ -1,1627 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- * Copyright (C) 1998 Elliot Lee
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
- * file for a list of people on the GTK+ Team.  See the ChangeLog
- * files for a list of changes.  These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/. 
- */
-
-#include "config.h"
-
-#include <stdlib.h>
-
-#define GDK_DISABLE_DEPRECATION_WARNINGS
-
-#include "gtkhandlebox.h"
-#include "gtkinvisible.h"
-#include "gtkmain.h"
-#include "gtkmarshalers.h"
-#include "gtkrender.h"
-#include "gtkwindow.h"
-#include "gtktypebuiltins.h"
-#include "gtkprivate.h"
-#include "gtkintl.h"
-
-
-/**
- * SECTION:gtkhandlebox
- * @Short_description: a widget for detachable window portions
- * @Title: GtkHandleBox
- *
- * The #GtkHandleBox widget allows a portion of a window to be "torn
- * off". It is a bin widget which displays its child and a handle that
- * the user can drag to tear off a separate window (the “float
- * window”) containing the child widget. A thin
- * “ghost” is drawn in the original location of the
- * handlebox. By dragging the separate window back to its original
- * location, it can be reattached.
- *
- * When reattaching, the ghost and float window, must be aligned
- * along one of the edges, the “snap edge”.
- * This either can be specified by the application programmer
- * explicitly, or GTK+ will pick a reasonable default based
- * on the handle position.
- *
- * To make detaching and reattaching the handlebox as minimally confusing
- * as possible to the user, it is important to set the snap edge so that
- * the snap edge does not move when the handlebox is deattached. For
- * instance, if the handlebox is packed at the bottom of a VBox, then
- * when the handlebox is detached, the bottom edge of the handlebox's
- * allocation will remain fixed as the height of the handlebox shrinks,
- * so the snap edge should be set to %GTK_POS_BOTTOM.
- *
- * > #GtkHandleBox has been deprecated. It is very specialized, lacks features
- * > to make it useful and most importantly does not fit well into modern
- * > application design. Do not use it. There is no replacement.
- */
-
-
-struct _GtkHandleBoxPrivate
-{
-  /* Properties */
-  GtkPositionType handle_position;
-  gint snap_edge;
-  GtkShadowType   shadow_type;
-  gboolean        child_detached;
-  /* Properties */
-
-  GtkAllocation   attach_allocation;
-  GtkAllocation   float_allocation;
-
-  GdkDevice      *grab_device;
-
-  GdkWindow      *bin_window;     /* parent window for children */
-  GdkWindow      *float_window;
-
-  /* Variables used during a drag
-   */
-  gint            orig_x;
-  gint            orig_y;
-
-  guint           float_window_mapped : 1;
-  guint           in_drag : 1;
-  guint           shrink_on_detach : 1;
-};
-
-enum {
-  PROP_0,
-  PROP_SHADOW_TYPE,
-  PROP_HANDLE_POSITION,
-  PROP_SNAP_EDGE,
-  PROP_SNAP_EDGE_SET,
-  PROP_CHILD_DETACHED
-};
-
-#define DRAG_HANDLE_SIZE 10
-#define CHILDLESS_SIZE 25
-#define GHOST_HEIGHT 3
-#define TOLERANCE 5
-
-enum {
-  SIGNAL_CHILD_ATTACHED,
-  SIGNAL_CHILD_DETACHED,
-  SIGNAL_LAST
-};
-
-/* The algorithm for docking and redocking implemented here
- * has a couple of nice properties:
- *
- * 1) During a single drag, docking always occurs at the
- *    the same cursor position. This means that the users
- *    motions are reversible, and that you won't
- *    undock/dock oscillations.
- *
- * 2) Docking generally occurs at user-visible features.
- *    The user, once they figure out to redock, will
- *    have useful information about doing it again in
- *    the future.
- *
- * Please try to preserve these properties if you
- * change the algorithm. (And the current algorithm
- * is far from ideal). Briefly, the current algorithm
- * for deciding whether the handlebox is docked or not:
- *
- * 1) The decision is done by comparing two rectangles - the
- *    allocation if the widget at the start of the drag,
- *    and the boundary of hb->bin_window at the start of
- *    of the drag offset by the distance that the cursor
- *    has moved.
- *
- * 2) These rectangles must have one edge, the “snap_edge”
- *    of the handlebox, aligned within TOLERANCE.
- * 
- * 3) On the other dimension, the extents of one rectangle
- *    must be contained in the extents of the other,
- *    extended by tolerance. That is, either we can have:
- *
- * <-TOLERANCE-|--------bin_window--------------|-TOLERANCE->
- *         <--------float_window-------------------->
- *
- * or we can have:
- *
- * <-TOLERANCE-|------float_window--------------|-TOLERANCE->
- *          <--------bin_window-------------------->
- */
-
-static void     gtk_handle_box_set_property  (GObject        *object,
-                                              guint           param_id,
-                                              const GValue   *value,
-                                              GParamSpec     *pspec);
-static void     gtk_handle_box_get_property  (GObject        *object,
-                                              guint           param_id,
-                                              GValue         *value,
-                                              GParamSpec     *pspec);
-static void     gtk_handle_box_map           (GtkWidget      *widget);
-static void     gtk_handle_box_unmap         (GtkWidget      *widget);
-static void     gtk_handle_box_realize       (GtkWidget      *widget);
-static void     gtk_handle_box_unrealize     (GtkWidget      *widget);
-static void     gtk_handle_box_style_updated (GtkWidget      *widget);
-static void     gtk_handle_box_size_request  (GtkWidget      *widget,
-                                              GtkRequisition *requisition);
-static void     gtk_handle_box_get_preferred_width (GtkWidget *widget,
-                                                   gint      *minimum,
-                                                   gint      *natural);
-static void     gtk_handle_box_get_preferred_height (GtkWidget *widget,
-                                                   gint      *minimum,
-                                                   gint      *natural);
-static void     gtk_handle_box_size_allocate (GtkWidget      *widget,
-                                              GtkAllocation  *real_allocation);
-static void     gtk_handle_box_add           (GtkContainer   *container,
-                                              GtkWidget      *widget);
-static void     gtk_handle_box_remove        (GtkContainer   *container,
-                                              GtkWidget      *widget);
-static gboolean gtk_handle_box_draw          (GtkWidget      *widget,
-                                              cairo_t        *cr);
-static gboolean gtk_handle_box_button_press  (GtkWidget      *widget,
-                                              GdkEventButton *event);
-static gboolean gtk_handle_box_motion        (GtkWidget      *widget,
-                                              GdkEventMotion *event);
-static gboolean gtk_handle_box_delete_event  (GtkWidget      *widget,
-                                              GdkEventAny    *event);
-static void     gtk_handle_box_reattach      (GtkHandleBox   *hb);
-static void     gtk_handle_box_end_drag      (GtkHandleBox   *hb,
-                                              guint32         time);
-
-static guint handle_box_signals[SIGNAL_LAST] = { 0 };
-
-G_DEFINE_TYPE_WITH_PRIVATE (GtkHandleBox, gtk_handle_box, GTK_TYPE_BIN)
-
-static void
-gtk_handle_box_class_init (GtkHandleBoxClass *class)
-{
-  GObjectClass *gobject_class;
-  GtkWidgetClass *widget_class;
-  GtkContainerClass *container_class;
-
-  gobject_class = (GObjectClass *) class;
-  widget_class = (GtkWidgetClass *) class;
-  container_class = (GtkContainerClass *) class;
-
-  gobject_class->set_property = gtk_handle_box_set_property;
-  gobject_class->get_property = gtk_handle_box_get_property;
-  
-  g_object_class_install_property (gobject_class,
-                                   PROP_SHADOW_TYPE,
-                                   g_param_spec_enum ("shadow-type",
-                                                      P_("Shadow type"),
-                                                      P_("Appearance of the shadow that surrounds the container"),
-                                                     GTK_TYPE_SHADOW_TYPE,
-                                                     GTK_SHADOW_OUT,
-                                                      GTK_PARAM_READWRITE));
-  
-  g_object_class_install_property (gobject_class,
-                                   PROP_HANDLE_POSITION,
-                                   g_param_spec_enum ("handle-position",
-                                                      P_("Handle position"),
-                                                      P_("Position of the handle relative to the child widget"),
-                                                     GTK_TYPE_POSITION_TYPE,
-                                                     GTK_POS_LEFT,
-                                                      GTK_PARAM_READWRITE));
-  
-  g_object_class_install_property (gobject_class,
-                                   PROP_SNAP_EDGE,
-                                   g_param_spec_enum ("snap-edge",
-                                                      P_("Snap edge"),
-                                                      P_("Side of the handlebox that's lined up with the docking point to dock the handlebox"),
-                                                     GTK_TYPE_POSITION_TYPE,
-                                                     GTK_POS_TOP,
-                                                      GTK_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_SNAP_EDGE_SET,
-                                   g_param_spec_boolean ("snap-edge-set",
-                                                        P_("Snap edge set"),
-                                                        P_("Whether to use the value from the snap_edge property or a value derived from handle_position"),
-                                                        FALSE,
-                                                        GTK_PARAM_READWRITE));
-
-  g_object_class_install_property (gobject_class,
-                                   PROP_CHILD_DETACHED,
-                                   g_param_spec_boolean ("child-detached",
-                                                        P_("Child Detached"),
-                                                        P_("A boolean value indicating whether the handlebox's child is attached or detached."),
-                                                        FALSE,
-                                                        GTK_PARAM_READABLE));
-
-  widget_class->map = gtk_handle_box_map;
-  widget_class->unmap = gtk_handle_box_unmap;
-  widget_class->realize = gtk_handle_box_realize;
-  widget_class->unrealize = gtk_handle_box_unrealize;
-  widget_class->style_updated = gtk_handle_box_style_updated;
-  widget_class->get_preferred_width = gtk_handle_box_get_preferred_width;
-  widget_class->get_preferred_height = gtk_handle_box_get_preferred_height;
-  widget_class->size_allocate = gtk_handle_box_size_allocate;
-  widget_class->draw = gtk_handle_box_draw;
-  widget_class->button_press_event = gtk_handle_box_button_press;
-  widget_class->delete_event = gtk_handle_box_delete_event;
-
-  container_class->add = gtk_handle_box_add;
-  container_class->remove = gtk_handle_box_remove;
-
-  class->child_attached = NULL;
-  class->child_detached = NULL;
-
-  /**
-   * GtkHandleBox::child-attached:
-   * @handlebox: the object which received the signal.
-   * @widget: the child widget of the handlebox.
-   *   (this argument provides no extra information
-   *   and is here only for backwards-compatibility)
-   *
-   * This signal is emitted when the contents of the
-   * handlebox are reattached to the main window.
-   *
-   * Deprecated: 3.4: #GtkHandleBox has been deprecated.
-   */
-  handle_box_signals[SIGNAL_CHILD_ATTACHED] =
-    g_signal_new (I_("child-attached"),
-                 G_OBJECT_CLASS_TYPE (gobject_class),
-                 G_SIGNAL_RUN_FIRST,
-                 G_STRUCT_OFFSET (GtkHandleBoxClass, child_attached),
-                 NULL, NULL,
-                 NULL,
-                 G_TYPE_NONE, 1,
-                 GTK_TYPE_WIDGET);
-
-  /**
-   * GtkHandleBox::child-detached:
-   * @handlebox: the object which received the signal.
-   * @widget: the child widget of the handlebox.
-   *   (this argument provides no extra information
-   *   and is here only for backwards-compatibility)
-   *
-   * This signal is emitted when the contents of the
-   * handlebox are detached from the main window.
-   *
-   * Deprecated: 3.4: #GtkHandleBox has been deprecated.
-   */
-  handle_box_signals[SIGNAL_CHILD_DETACHED] =
-    g_signal_new (I_("child-detached"),
-                 G_OBJECT_CLASS_TYPE (gobject_class),
-                 G_SIGNAL_RUN_FIRST,
-                 G_STRUCT_OFFSET (GtkHandleBoxClass, child_detached),
-                 NULL, NULL,
-                 NULL,
-                 G_TYPE_NONE, 1,
-                 GTK_TYPE_WIDGET);
-}
-
-static void
-gtk_handle_box_init (GtkHandleBox *handle_box)
-{
-  GtkHandleBoxPrivate *priv;
-  GtkStyleContext *context;
-
-  handle_box->priv = gtk_handle_box_get_instance_private (handle_box);
-  priv = handle_box->priv;
-
-  gtk_widget_set_has_window (GTK_WIDGET (handle_box), TRUE);
-
-  priv->bin_window = NULL;
-  priv->float_window = NULL;
-  priv->shadow_type = GTK_SHADOW_OUT;
-  priv->handle_position = GTK_POS_LEFT;
-  priv->float_window_mapped = FALSE;
-  priv->child_detached = FALSE;
-  priv->in_drag = FALSE;
-  priv->shrink_on_detach = TRUE;
-  priv->snap_edge = -1;
-
-  context = gtk_widget_get_style_context (GTK_WIDGET (handle_box));
-  gtk_style_context_add_class (context, GTK_STYLE_CLASS_DOCK);
-}
-
-static void 
-gtk_handle_box_set_property (GObject         *object,
-                            guint            prop_id,
-                            const GValue    *value,
-                            GParamSpec      *pspec)
-{
-  GtkHandleBox *handle_box = GTK_HANDLE_BOX (object);
-
-  switch (prop_id)
-    {
-    case PROP_SHADOW_TYPE:
-      gtk_handle_box_set_shadow_type (handle_box, g_value_get_enum (value));
-      break;
-    case PROP_HANDLE_POSITION:
-      gtk_handle_box_set_handle_position (handle_box, g_value_get_enum (value));
-      break;
-    case PROP_SNAP_EDGE:
-      gtk_handle_box_set_snap_edge (handle_box, g_value_get_enum (value));
-      break;
-    case PROP_SNAP_EDGE_SET:
-      if (!g_value_get_boolean (value))
-       gtk_handle_box_set_snap_edge (handle_box, (GtkPositionType)-1);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-static void 
-gtk_handle_box_get_property (GObject         *object,
-                            guint            prop_id,
-                            GValue          *value,
-                            GParamSpec      *pspec)
-{
-  GtkHandleBox *handle_box = GTK_HANDLE_BOX (object);
-  GtkHandleBoxPrivate *priv = handle_box->priv;
-
-  switch (prop_id)
-    {
-    case PROP_SHADOW_TYPE:
-      g_value_set_enum (value, priv->shadow_type);
-      break;
-    case PROP_HANDLE_POSITION:
-      g_value_set_enum (value, priv->handle_position);
-      break;
-    case PROP_SNAP_EDGE:
-      g_value_set_enum (value,
-                       (priv->snap_edge == -1 ?
-                        GTK_POS_TOP : priv->snap_edge));
-      break;
-    case PROP_SNAP_EDGE_SET:
-      g_value_set_boolean (value, priv->snap_edge != -1);
-      break;
-    case PROP_CHILD_DETACHED:
-      g_value_set_boolean (value, priv->child_detached);
-      break;
-    default:
-      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
-      break;
-    }
-}
-
-/**
- * gtk_handle_box_new:
- *
- * Create a new handle box.
- *
- * Returns: a new #GtkHandleBox.
- *
- * Deprecated: 3.4: #GtkHandleBox has been deprecated.
- */
-GtkWidget*
-gtk_handle_box_new (void)
-{
-  return g_object_new (GTK_TYPE_HANDLE_BOX, NULL);
-}
-
-static void
-gtk_handle_box_map (GtkWidget *widget)
-{
-  GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
-  GtkHandleBoxPrivate *priv = hb->priv;
-  GtkBin *bin = GTK_BIN (widget);
-  GtkWidget *child;
-
-  gtk_widget_set_mapped (widget, TRUE);
-
-  child = gtk_bin_get_child (bin);
-  if (child != NULL &&
-      gtk_widget_get_visible (child) &&
-      !gtk_widget_get_mapped (child))
-    gtk_widget_map (child);
-
-  if (priv->child_detached && !priv->float_window_mapped)
-    {
-      gdk_window_show (priv->float_window);
-      priv->float_window_mapped = TRUE;
-    }
-
-  gdk_window_show (priv->bin_window);
-  gdk_window_show (gtk_widget_get_window (widget));
-}
-
-static void
-gtk_handle_box_unmap (GtkWidget *widget)
-{
-  GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
-  GtkHandleBoxPrivate *priv = hb->priv;
-
-  gtk_widget_set_mapped (widget, FALSE);
-
-  gdk_window_hide (gtk_widget_get_window (widget));
-  if (priv->float_window_mapped)
-    {
-      gdk_window_hide (priv->float_window);
-      priv->float_window_mapped = FALSE;
-    }
-
-  GTK_WIDGET_CLASS (gtk_handle_box_parent_class)->unmap (widget);
-}
-
-static void
-gtk_handle_box_realize (GtkWidget *widget)
-{
-  GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
-  GtkHandleBoxPrivate *priv = hb->priv;
-  GtkAllocation allocation;
-  GtkRequisition requisition;
-  GtkStyleContext *context;
-  GtkWidget *child;
-  GdkWindow *window;
-  GdkWindowAttr attributes;
-  gint attributes_mask;
-
-  gtk_widget_set_realized (widget, TRUE);
-
-  gtk_widget_get_allocation (widget, &allocation);
-
-  attributes.x = allocation.x;
-  attributes.y = allocation.y;
-  attributes.width = allocation.width;
-  attributes.height = allocation.height;
-  attributes.window_type = GDK_WINDOW_CHILD;
-  attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
-  attributes.event_mask = gtk_widget_get_events (widget);
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
-
-  window = gdk_window_new (gtk_widget_get_parent_window (widget),
-                           &attributes, attributes_mask);
-  gtk_widget_set_window (widget, window);
-  gdk_window_set_user_data (window, widget);
-
-  attributes.x = 0;
-  attributes.y = 0;
-  attributes.width = allocation.width;
-  attributes.height = allocation.height;
-  attributes.window_type = GDK_WINDOW_CHILD;
-  attributes.event_mask = (gtk_widget_get_events (widget)
-                           | GDK_BUTTON1_MOTION_MASK
-                           | GDK_POINTER_MOTION_HINT_MASK
-                           | GDK_BUTTON_PRESS_MASK
-                           | GDK_BUTTON_RELEASE_MASK);
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
-
-  priv->bin_window = gdk_window_new (window,
-                                     &attributes, attributes_mask);
-  gdk_window_set_user_data (priv->bin_window, widget);
-
-  child = gtk_bin_get_child (GTK_BIN (hb));
-  if (child)
-    gtk_widget_set_parent_window (child, priv->bin_window);
-
-  gtk_widget_get_preferred_size (widget, &requisition, NULL);
-
-  attributes.x = 0;
-  attributes.y = 0;
-  attributes.width = requisition.width;
-  attributes.height = requisition.height;
-  attributes.window_type = GDK_WINDOW_TOPLEVEL;
-  attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
-  attributes.event_mask = (gtk_widget_get_events (widget)
-                           | GDK_KEY_PRESS_MASK
-                           | GDK_ENTER_NOTIFY_MASK
-                           | GDK_LEAVE_NOTIFY_MASK
-                           | GDK_FOCUS_CHANGE_MASK
-                           | GDK_STRUCTURE_MASK);
-  attributes.type_hint = GDK_WINDOW_TYPE_HINT_TOOLBAR;
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL | GDK_WA_TYPE_HINT;
-  priv->float_window = gdk_window_new (gdk_screen_get_root_window (gtk_widget_get_screen (widget)),
-                                       &attributes, attributes_mask);
-  gdk_window_set_user_data (priv->float_window, widget);
-  gdk_window_set_decorations (priv->float_window, 0);
-  gdk_window_set_type_hint (priv->float_window, GDK_WINDOW_TYPE_HINT_TOOLBAR);
-
-  context = gtk_widget_get_style_context (widget);
-  gtk_style_context_set_background (context, window);
-  gtk_style_context_set_background (context, priv->bin_window);
-  gtk_style_context_set_background (context, priv->float_window);
-}
-
-static void
-gtk_handle_box_unrealize (GtkWidget *widget)
-{
-  GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
-  GtkHandleBoxPrivate *priv = hb->priv;
-
-  gdk_window_set_user_data (priv->bin_window, NULL);
-  gdk_window_destroy (priv->bin_window);
-  priv->bin_window = NULL;
-  gdk_window_set_user_data (priv->float_window, NULL);
-  gdk_window_destroy (priv->float_window);
-  priv->float_window = NULL;
-
-  GTK_WIDGET_CLASS (gtk_handle_box_parent_class)->unrealize (widget);
-}
-
-static void
-gtk_handle_box_style_updated (GtkWidget *widget)
-{
-  GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
-  GtkHandleBoxPrivate *priv = hb->priv;
-
-  GTK_WIDGET_CLASS (gtk_handle_box_parent_class)->style_updated (widget);
-
-  if (gtk_widget_get_realized (widget) &&
-      gtk_widget_get_has_window (widget))
-    {
-      GtkStateFlags state;
-      GtkStyleContext *context;
-
-      context = gtk_widget_get_style_context (widget);
-      state = gtk_widget_get_state_flags (widget);
-
-      gtk_style_context_save (context);
-      gtk_style_context_set_state (context, state);
-
-      gtk_style_context_set_background (context, gtk_widget_get_window (widget));
-      gtk_style_context_set_background (context, priv->bin_window);
-      gtk_style_context_set_background (context, priv->float_window);
-
-      gtk_style_context_restore (context);
-    }
-}
-
-static int
-effective_handle_position (GtkHandleBox *hb)
-{
-  GtkHandleBoxPrivate *priv = hb->priv;
-  int handle_position;
-
-  if (gtk_widget_get_direction (GTK_WIDGET (hb)) == GTK_TEXT_DIR_LTR)
-    handle_position = priv->handle_position;
-  else
-    {
-      switch (priv->handle_position)
-       {
-       case GTK_POS_LEFT:
-         handle_position = GTK_POS_RIGHT;
-         break;
-       case GTK_POS_RIGHT:
-         handle_position = GTK_POS_LEFT;
-         break;
-       default:
-         handle_position = priv->handle_position;
-         break;
-       }
-    }
-
-  return handle_position;
-}
-
-static void
-gtk_handle_box_size_request (GtkWidget      *widget,
-                            GtkRequisition *requisition)
-{
-  GtkBin *bin = GTK_BIN (widget);
-  GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
-  GtkHandleBoxPrivate *priv = hb->priv;
-  GtkRequisition child_requisition;
-  GtkWidget *child;
-  gint handle_position;
-
-  handle_position = effective_handle_position (hb);
-
-  if (handle_position == GTK_POS_LEFT ||
-      handle_position == GTK_POS_RIGHT)
-    {
-      requisition->width = DRAG_HANDLE_SIZE;
-      requisition->height = 0;
-    }
-  else
-    {
-      requisition->width = 0;
-      requisition->height = DRAG_HANDLE_SIZE;
-    }
-
-  child = gtk_bin_get_child (bin);
-  /* if our child is not visible, we still request its size, since we
-   * won't have any useful hint for our size otherwise.
-   */
-  if (child)
-    {
-      gtk_widget_get_preferred_size (child, &child_requisition, NULL);
-    }
-  else
-    {
-      child_requisition.width = 0;
-      child_requisition.height = 0;
-    }      
-
-  if (priv->child_detached)
-    {
-      /* FIXME: This doesn't work currently */
-      if (!priv->shrink_on_detach)
-       {
-         if (handle_position == GTK_POS_LEFT ||
-             handle_position == GTK_POS_RIGHT)
-           requisition->height += child_requisition.height;
-         else
-           requisition->width += child_requisition.width;
-       }
-      else
-       {
-          GtkStyleContext *context;
-          GtkStateFlags state;
-          GtkBorder padding;
-
-          context = gtk_widget_get_style_context (widget);
-          state = gtk_widget_get_state_flags (widget);
-          gtk_style_context_get_padding (context, state, &padding);
-
-         if (handle_position == GTK_POS_LEFT ||
-             handle_position == GTK_POS_RIGHT)
-           requisition->height += padding.top;
-         else
-           requisition->width += padding.left;
-       }
-    }
-  else
-    {
-      guint border_width;
-
-      border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
-      requisition->width += border_width * 2;
-      requisition->height += border_width * 2;
-      
-      if (child)
-       {
-         requisition->width += child_requisition.width;
-         requisition->height += child_requisition.height;
-       }
-      else
-       {
-         requisition->width += CHILDLESS_SIZE;
-         requisition->height += CHILDLESS_SIZE;
-       }
-    }
-}
-
-static void
-gtk_handle_box_get_preferred_width (GtkWidget *widget,
-                                    gint      *minimum,
-                                    gint      *natural)
-{
-  GtkRequisition requisition;
-
-  gtk_handle_box_size_request (widget, &requisition);
-
-  *minimum = *natural = requisition.width;
-}
-
-static void
-gtk_handle_box_get_preferred_height (GtkWidget *widget,
-                                    gint      *minimum,
-                                    gint      *natural)
-{
-  GtkRequisition requisition;
-
-  gtk_handle_box_size_request (widget, &requisition);
-
-  *minimum = *natural = requisition.height;
-}
-
-
-static void
-gtk_handle_box_size_allocate (GtkWidget     *widget,
-                             GtkAllocation *allocation)
-{
-  GtkBin *bin = GTK_BIN (widget);
-  GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
-  GtkHandleBoxPrivate *priv = hb->priv;
-  GtkRequisition child_requisition;
-  GtkWidget *child;
-  gint handle_position;
-
-  handle_position = effective_handle_position (hb);
-
-  child = gtk_bin_get_child (bin);
-
-  if (child)
-    {
-      gtk_widget_get_preferred_size (child, &child_requisition, NULL);
-    }
-  else
-    {
-      child_requisition.width = 0;
-      child_requisition.height = 0;
-    }
-
-  gtk_widget_set_allocation (widget, allocation);
-
-  if (gtk_widget_get_realized (widget))
-    gdk_window_move_resize (gtk_widget_get_window (widget),
-                            allocation->x, allocation->y,
-                            allocation->width, allocation->height);
-
-  if (child != NULL && gtk_widget_get_visible (child))
-    {
-      GtkAllocation child_allocation;
-      guint border_width;
-
-      border_width = gtk_container_get_border_width (GTK_CONTAINER (widget));
-
-      child_allocation.x = border_width;
-      child_allocation.y = border_width;
-      if (handle_position == GTK_POS_LEFT)
-       child_allocation.x += DRAG_HANDLE_SIZE;
-      else if (handle_position == GTK_POS_TOP)
-       child_allocation.y += DRAG_HANDLE_SIZE;
-
-      if (priv->child_detached)
-       {
-         guint float_width;
-         guint float_height;
-         
-         child_allocation.width = child_requisition.width;
-         child_allocation.height = child_requisition.height;
-         
-         float_width = child_allocation.width + 2 * border_width;
-         float_height = child_allocation.height + 2 * border_width;
-         
-         if (handle_position == GTK_POS_LEFT ||
-             handle_position == GTK_POS_RIGHT)
-           float_width += DRAG_HANDLE_SIZE;
-         else
-           float_height += DRAG_HANDLE_SIZE;
-
-         if (gtk_widget_get_realized (widget))
-           {
-             gdk_window_resize (priv->float_window,
-                                float_width,
-                                float_height);
-             gdk_window_move_resize (priv->bin_window,
-                                     0,
-                                     0,
-                                     float_width,
-                                     float_height);
-           }
-       }
-      else
-       {
-         child_allocation.width = MAX (1, (gint) allocation->width - 2 * border_width);
-         child_allocation.height = MAX (1, (gint) allocation->height - 2 * border_width);
-
-         if (handle_position == GTK_POS_LEFT ||
-             handle_position == GTK_POS_RIGHT)
-           child_allocation.width -= DRAG_HANDLE_SIZE;
-         else
-           child_allocation.height -= DRAG_HANDLE_SIZE;
-         
-         if (gtk_widget_get_realized (widget))
-           gdk_window_move_resize (priv->bin_window,
-                                   0,
-                                   0,
-                                   allocation->width,
-                                   allocation->height);
-       }
-
-      gtk_widget_size_allocate (child, &child_allocation);
-    }
-}
-
-static void
-gtk_handle_box_draw_ghost (GtkHandleBox *hb,
-                           cairo_t      *cr)
-{
-  GtkWidget *widget = GTK_WIDGET (hb);
-  GtkStateFlags state;
-  GtkStyleContext *context;
-  guint x;
-  guint y;
-  guint width;
-  guint height;
-  gint allocation_width;
-  gint allocation_height;
-  gint handle_position;
-
-  handle_position = effective_handle_position (hb);
-  allocation_width = gtk_widget_get_allocated_width (widget);
-  allocation_height = gtk_widget_get_allocated_height (widget);
-
-  if (handle_position == GTK_POS_LEFT ||
-      handle_position == GTK_POS_RIGHT)
-    {
-      x = handle_position == GTK_POS_LEFT ? 0 : allocation_width - DRAG_HANDLE_SIZE;
-      y = 0;
-      width = DRAG_HANDLE_SIZE;
-      height = allocation_height;
-    }
-  else
-    {
-      x = 0;
-      y = handle_position == GTK_POS_TOP ? 0 : allocation_height - DRAG_HANDLE_SIZE;
-      width = allocation_width;
-      height = DRAG_HANDLE_SIZE;
-    }
-
-  context = gtk_widget_get_style_context (widget);
-  state = gtk_widget_get_state_flags (widget);
-
-  gtk_style_context_save (context);
-  gtk_style_context_set_state (context, state);
-
-  gtk_render_background (context, cr, x, y, width, height);
-  gtk_render_frame (context, cr, x, y, width, height);
-
-  if (handle_position == GTK_POS_LEFT ||
-      handle_position == GTK_POS_RIGHT)
-    gtk_render_line (context, cr,
-                     handle_position == GTK_POS_LEFT ? DRAG_HANDLE_SIZE : 0,
-                     allocation_height / 2,
-                     handle_position == GTK_POS_LEFT ? allocation_width : allocation_width - DRAG_HANDLE_SIZE,
-                     allocation_height / 2);
-  else
-    gtk_render_line (context, cr,
-                     allocation_width / 2,
-                     handle_position == GTK_POS_TOP ? DRAG_HANDLE_SIZE : 0,
-                     allocation_width / 2,
-                     handle_position == GTK_POS_TOP ? allocation_height : allocation_height - DRAG_HANDLE_SIZE);
-
-  gtk_style_context_restore (context);
-}
-
-/**
- * gtk_handle_box_set_shadow_type:
- * @handle_box: a #GtkHandleBox
- * @type: the shadow type.
- *
- * Sets the type of shadow to be drawn around the border
- * of the handle box.
- *
- * Deprecated: 3.4: #GtkHandleBox has been deprecated.
- */
-void
-gtk_handle_box_set_shadow_type (GtkHandleBox  *handle_box,
-                               GtkShadowType  type)
-{
-  GtkHandleBoxPrivate *priv;
-
-  g_return_if_fail (GTK_IS_HANDLE_BOX (handle_box));
-
-  priv = handle_box->priv;
-
-  if ((GtkShadowType) priv->shadow_type != type)
-    {
-      priv->shadow_type = type;
-      g_object_notify (G_OBJECT (handle_box), "shadow-type");
-      gtk_widget_queue_resize (GTK_WIDGET (handle_box));
-    }
-}
-
-/**
- * gtk_handle_box_get_shadow_type:
- * @handle_box: a #GtkHandleBox
- *
- * Gets the type of shadow drawn around the handle box. See
- * gtk_handle_box_set_shadow_type().
- *
- * Returns: the type of shadow currently drawn around the handle box.
- *
- * Deprecated: 3.4: #GtkHandleBox has been deprecated.
- **/
-GtkShadowType
-gtk_handle_box_get_shadow_type (GtkHandleBox *handle_box)
-{
-  g_return_val_if_fail (GTK_IS_HANDLE_BOX (handle_box), GTK_SHADOW_ETCHED_OUT);
-
-  return handle_box->priv->shadow_type;
-}
-
-/**
- * gtk_handle_box_set_handle_position:
- * @handle_box: a #GtkHandleBox
- * @position: the side of the handlebox where the handle should be drawn.
- *
- * Sets the side of the handlebox where the handle is drawn.
- *
- * Deprecated: 3.4: #GtkHandleBox has been deprecated.
- */
-void        
-gtk_handle_box_set_handle_position  (GtkHandleBox    *handle_box,
-                                    GtkPositionType  position)
-{
-  GtkHandleBoxPrivate *priv;
-
-  g_return_if_fail (GTK_IS_HANDLE_BOX (handle_box));
-
-  priv = handle_box->priv;
-
-  if ((GtkPositionType) priv->handle_position != position)
-    {
-      priv->handle_position = position;
-      g_object_notify (G_OBJECT (handle_box), "handle-position");
-      gtk_widget_queue_resize (GTK_WIDGET (handle_box));
-    }
-}
-
-/**
- * gtk_handle_box_get_handle_position:
- * @handle_box: a #GtkHandleBox
- *
- * Gets the handle position of the handle box. See
- * gtk_handle_box_set_handle_position().
- *
- * Returns: the current handle position.
- *
- * Deprecated: 3.4: #GtkHandleBox has been deprecated.
- **/
-GtkPositionType
-gtk_handle_box_get_handle_position (GtkHandleBox *handle_box)
-{
-  g_return_val_if_fail (GTK_IS_HANDLE_BOX (handle_box), GTK_POS_LEFT);
-
-  return handle_box->priv->handle_position;
-}
-
-/**
- * gtk_handle_box_set_snap_edge:
- * @handle_box: a #GtkHandleBox
- * @edge: the snap edge, or -1 to unset the value; in which
- *   case GTK+ will try to guess an appropriate value
- *   in the future.
- *
- * Sets the snap edge of a handlebox. The snap edge is
- * the edge of the detached child that must be aligned
- * with the corresponding edge of the “ghost” left
- * behind when the child was detached to reattach
- * the torn-off window. Usually, the snap edge should
- * be chosen so that it stays in the same place on
- * the screen when the handlebox is torn off.
- *
- * If the snap edge is not set, then an appropriate value
- * will be guessed from the handle position. If the
- * handle position is %GTK_POS_RIGHT or %GTK_POS_LEFT,
- * then the snap edge will be %GTK_POS_TOP, otherwise
- * it will be %GTK_POS_LEFT.
- *
- * Deprecated: 3.4: #GtkHandleBox has been deprecated.
- */
-void
-gtk_handle_box_set_snap_edge        (GtkHandleBox    *handle_box,
-                                    GtkPositionType  edge)
-{
-  GtkHandleBoxPrivate *priv;
-
-  g_return_if_fail (GTK_IS_HANDLE_BOX (handle_box));
-
-  priv = handle_box->priv;
-
-  if (priv->snap_edge != edge)
-    {
-      priv->snap_edge = edge;
-
-      g_object_freeze_notify (G_OBJECT (handle_box));
-      g_object_notify (G_OBJECT (handle_box), "snap-edge");
-      g_object_notify (G_OBJECT (handle_box), "snap-edge-set");
-      g_object_thaw_notify (G_OBJECT (handle_box));
-    }
-}
-
-/**
- * gtk_handle_box_get_snap_edge:
- * @handle_box: a #GtkHandleBox
- *
- * Gets the edge used for determining reattachment of the handle box.
- * See gtk_handle_box_set_snap_edge().
- *
- * Returns: the edge used for determining reattachment, or
- *   (GtkPositionType)-1 if this is determined (as per default)
- *   from the handle position.
- *
- * Deprecated: 3.4: #GtkHandleBox has been deprecated.
- **/
-GtkPositionType
-gtk_handle_box_get_snap_edge (GtkHandleBox *handle_box)
-{
-  g_return_val_if_fail (GTK_IS_HANDLE_BOX (handle_box), (GtkPositionType)-1);
-
-  return (GtkPositionType)handle_box->priv->snap_edge;
-}
-
-/**
- * gtk_handle_box_get_child_detached:
- * @handle_box: a #GtkHandleBox
- *
- * Whether the handlebox’s child is currently detached.
- *
- * Returns: %TRUE if the child is currently detached, otherwise %FALSE
- *
- * Since: 2.14
- *
- * Deprecated: 3.4: #GtkHandleBox has been deprecated.
- **/
-gboolean
-gtk_handle_box_get_child_detached (GtkHandleBox *handle_box)
-{
-  g_return_val_if_fail (GTK_IS_HANDLE_BOX (handle_box), FALSE);
-
-  return handle_box->priv->child_detached;
-}
-
-static void
-gtk_handle_box_paint (GtkWidget *widget,
-                      cairo_t   *cr)
-{
-  GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
-  GtkHandleBoxPrivate *priv = hb->priv;
-  GtkBin *bin = GTK_BIN (widget);
-  GtkStyleContext *context;
-  GtkStateFlags state;
-  GtkWidget *child;
-  gint width, height;
-  GdkRectangle rect;
-  gint handle_position;
-
-  handle_position = effective_handle_position (hb);
-
-  width = gdk_window_get_width (priv->bin_window);
-  height = gdk_window_get_height (priv->bin_window);
-
-  context = gtk_widget_get_style_context (widget);
-  state = gtk_widget_get_state_flags (widget);
-
-  gtk_style_context_save (context);
-  gtk_style_context_set_state (context, state);
-
-  gtk_render_background (context, cr, 0, 0, width, height);
-  gtk_render_frame (context, cr, 0, 0, width, height);
-
-  switch (handle_position)
-    {
-    case GTK_POS_LEFT:
-      rect.x = 0;
-      rect.y = 0;
-      rect.width = DRAG_HANDLE_SIZE;
-      rect.height = height;
-      break;
-    case GTK_POS_RIGHT:
-      rect.x = width - DRAG_HANDLE_SIZE;
-      rect.y = 0;
-      rect.width = DRAG_HANDLE_SIZE;
-      rect.height = height;
-      break;
-    case GTK_POS_TOP:
-      rect.x = 0;
-      rect.y = 0;
-      rect.width = width;
-      rect.height = DRAG_HANDLE_SIZE;
-      break;
-    case GTK_POS_BOTTOM:
-      rect.x = 0;
-      rect.y = height - DRAG_HANDLE_SIZE;
-      rect.width = width;
-      rect.height = DRAG_HANDLE_SIZE;
-      break;
-    default:
-      g_assert_not_reached ();
-      break;
-    }
-
-  gtk_render_handle (context, cr,
-                     rect.x, rect.y, rect.width, rect.height);
-
-  child = gtk_bin_get_child (bin);
-  if (child != NULL && gtk_widget_get_visible (child))
-    GTK_WIDGET_CLASS (gtk_handle_box_parent_class)->draw (widget, cr);
-
-  gtk_style_context_restore (context);
-}
-
-static gboolean
-gtk_handle_box_draw (GtkWidget *widget,
-                    cairo_t   *cr)
-{
-  GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
-  GtkHandleBoxPrivate *priv = hb->priv;
-
-  if (gtk_cairo_should_draw_window (cr, gtk_widget_get_window (widget)))
-    {
-      if (priv->child_detached)
-        gtk_handle_box_draw_ghost (hb, cr);
-    }
-  else if (gtk_cairo_should_draw_window (cr, priv->bin_window))
-    gtk_handle_box_paint (widget, cr);
-  
-  return FALSE;
-}
-
-static GtkWidget *
-gtk_handle_box_get_invisible (void)
-{
-  static GtkWidget *handle_box_invisible = NULL;
-
-  if (!handle_box_invisible)
-    {
-      handle_box_invisible = gtk_invisible_new ();
-      gtk_widget_show (handle_box_invisible);
-    }
-  
-  return handle_box_invisible;
-}
-
-static gboolean
-gtk_handle_box_grab_event (GtkWidget    *widget,
-                          GdkEvent     *event,
-                          GtkHandleBox *hb)
-{
-  GtkHandleBoxPrivate *priv = hb->priv;
-
-  switch (event->type)
-    {
-    case GDK_BUTTON_RELEASE:
-      if (priv->in_drag)               /* sanity check */
-       {
-         gtk_handle_box_end_drag (hb, event->button.time);
-         return TRUE;
-       }
-      break;
-
-    case GDK_MOTION_NOTIFY:
-      return gtk_handle_box_motion (GTK_WIDGET (hb), (GdkEventMotion *)event);
-      break;
-
-    default:
-      break;
-    }
-
-  return FALSE;
-}
-
-static gboolean
-gtk_handle_box_button_press (GtkWidget      *widget,
-                             GdkEventButton *event)
-{
-  GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
-  GtkHandleBoxPrivate *priv = hb->priv;
-  gboolean event_handled;
-  GdkCursor *fleur;
-  gint handle_position;
-
-  handle_position = effective_handle_position (hb);
-
-  event_handled = FALSE;
-  if ((event->button == GDK_BUTTON_PRIMARY) &&
-      (event->type == GDK_BUTTON_PRESS || event->type == GDK_2BUTTON_PRESS))
-    {
-      GtkWidget *child;
-      gboolean in_handle;
-      
-      if (event->window != priv->bin_window)
-       return FALSE;
-
-      child = gtk_bin_get_child (GTK_BIN (hb));
-
-      if (child)
-       {
-          GtkAllocation child_allocation;
-          guint border_width;
-
-          gtk_widget_get_allocation (child, &child_allocation);
-          border_width = gtk_container_get_border_width (GTK_CONTAINER (hb));
-
-         switch (handle_position)
-           {
-           case GTK_POS_LEFT:
-             in_handle = event->x < DRAG_HANDLE_SIZE;
-             break;
-           case GTK_POS_TOP:
-             in_handle = event->y < DRAG_HANDLE_SIZE;
-             break;
-           case GTK_POS_RIGHT:
-             in_handle = event->x > 2 * border_width + child_allocation.width;
-             break;
-           case GTK_POS_BOTTOM:
-             in_handle = event->y > 2 * border_width + child_allocation.height;
-             break;
-           default:
-             in_handle = FALSE;
-             break;
-           }
-       }
-      else
-       {
-         in_handle = FALSE;
-         event_handled = TRUE;
-       }
-      
-      if (in_handle)
-       {
-         if (event->type == GDK_BUTTON_PRESS) /* Start a drag */
-           {
-             GtkWidget *invisible = gtk_handle_box_get_invisible ();
-              GdkWindow *window;
-             gint root_x, root_y;
-
-              gtk_invisible_set_screen (GTK_INVISIBLE (invisible),
-                                        gtk_widget_get_screen (GTK_WIDGET (hb)));
-             gdk_window_get_origin (priv->bin_window, &root_x, &root_y);
-
-             priv->orig_x = event->x_root;
-             priv->orig_y = event->y_root;
-
-             priv->float_allocation.x = root_x - event->x_root;
-             priv->float_allocation.y = root_y - event->y_root;
-             priv->float_allocation.width = gdk_window_get_width (priv->bin_window);
-             priv->float_allocation.height = gdk_window_get_height (priv->bin_window);
-
-              window = gtk_widget_get_window (widget);
-             if (gdk_window_is_viewable (window))
-               {
-                 gdk_window_get_origin (window, &root_x, &root_y);
-
-                 priv->attach_allocation.x = root_x;
-                 priv->attach_allocation.y = root_y;
-                 priv->attach_allocation.width = gdk_window_get_width (window);
-                 priv->attach_allocation.height = gdk_window_get_height (window);
-               }
-             else
-               {
-                 priv->attach_allocation.x = -1;
-                 priv->attach_allocation.y = -1;
-                 priv->attach_allocation.width = 0;
-                 priv->attach_allocation.height = 0;
-               }
-             priv->in_drag = TRUE;
-              priv->grab_device = event->device;
-             fleur = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
-                                                 GDK_FLEUR);
-             if (gdk_device_grab (event->device,
-                                   gtk_widget_get_window (invisible),
-                                   GDK_OWNERSHIP_WINDOW,
-                                   FALSE,
-                                   (GDK_BUTTON1_MOTION_MASK |
-                                    GDK_POINTER_MOTION_HINT_MASK |
-                                    GDK_BUTTON_RELEASE_MASK),
-                                   fleur,
-                                   event->time) != GDK_GRAB_SUCCESS)
-               {
-                 priv->in_drag = FALSE;
-                  priv->grab_device = NULL;
-               }
-             else
-               {
-                  gtk_device_grab_add (invisible, priv->grab_device, TRUE);
-                 g_signal_connect (invisible, "event",
-                                   G_CALLBACK (gtk_handle_box_grab_event), hb);
-               }
-
-             g_object_unref (fleur);
-             event_handled = TRUE;
-           }
-         else if (priv->child_detached) /* Double click */
-           {
-             gtk_handle_box_reattach (hb);
-           }
-       }
-    }
-  
-  return event_handled;
-}
-
-static gboolean
-gtk_handle_box_motion (GtkWidget      *widget,
-                      GdkEventMotion *event)
-{
-  GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
-  GtkHandleBoxPrivate *priv = hb->priv;
-  GtkWidget *child;
-  gint new_x, new_y;
-  gint snap_edge;
-  gboolean is_snapped = FALSE;
-  gint handle_position;
-  GdkGeometry geometry;
-  GdkScreen *screen, *pointer_screen;
-
-  if (!priv->in_drag)
-    return FALSE;
-  handle_position = effective_handle_position (hb);
-
-  /* Calculate the attachment point on the float, if the float
-   * were detached
-   */
-  new_x = 0;
-  new_y = 0;
-  screen = gtk_widget_get_screen (widget);
-  gdk_device_get_position (event->device,
-                           &pointer_screen,
-                           &new_x, &new_y);
-  if (pointer_screen != screen)
-    {
-      new_x = priv->orig_x;
-      new_y = priv->orig_y;
-    }
-
-  new_x += priv->float_allocation.x;
-  new_y += priv->float_allocation.y;
-
-  snap_edge = priv->snap_edge;
-  if (snap_edge == -1)
-    snap_edge = (handle_position == GTK_POS_LEFT ||
-                handle_position == GTK_POS_RIGHT) ?
-      GTK_POS_TOP : GTK_POS_LEFT;
-
-  if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) 
-    switch (snap_edge) 
-      {
-      case GTK_POS_LEFT:
-       snap_edge = GTK_POS_RIGHT;
-       break;
-      case GTK_POS_RIGHT:
-       snap_edge = GTK_POS_LEFT;
-       break;
-      default:
-       break;
-      }
-
-  /* First, check if the snapped edge is aligned
-   */
-  switch (snap_edge)
-    {
-    case GTK_POS_TOP:
-      is_snapped = abs (priv->attach_allocation.y - new_y) < TOLERANCE;
-      break;
-    case GTK_POS_BOTTOM:
-      is_snapped = abs (priv->attach_allocation.y + (gint)priv->attach_allocation.height -
-                       new_y - (gint)priv->float_allocation.height) < TOLERANCE;
-      break;
-    case GTK_POS_LEFT:
-      is_snapped = abs (priv->attach_allocation.x - new_x) < TOLERANCE;
-      break;
-    case GTK_POS_RIGHT:
-      is_snapped = abs (priv->attach_allocation.x + (gint)priv->attach_allocation.width -
-                       new_x - (gint)priv->float_allocation.width) < TOLERANCE;
-      break;
-    }
-
-  /* Next, check if coordinates in the other direction are sufficiently
-   * aligned
-   */
-  if (is_snapped)
-    {
-      gint float_pos1 = 0;     /* Initialize to suppress warnings */
-      gint float_pos2 = 0;
-      gint attach_pos1 = 0;
-      gint attach_pos2 = 0;
-      
-      switch (snap_edge)
-       {
-       case GTK_POS_TOP:
-       case GTK_POS_BOTTOM:
-         attach_pos1 = priv->attach_allocation.x;
-         attach_pos2 = priv->attach_allocation.x + priv->attach_allocation.width;
-         float_pos1 = new_x;
-         float_pos2 = new_x + priv->float_allocation.width;
-         break;
-       case GTK_POS_LEFT:
-       case GTK_POS_RIGHT:
-         attach_pos1 = priv->attach_allocation.y;
-         attach_pos2 = priv->attach_allocation.y + priv->attach_allocation.height;
-         float_pos1 = new_y;
-         float_pos2 = new_y + priv->float_allocation.height;
-         break;
-       }
-
-      is_snapped = ((attach_pos1 - TOLERANCE < float_pos1) && 
-                   (attach_pos2 + TOLERANCE > float_pos2)) ||
-                  ((float_pos1 - TOLERANCE < attach_pos1) &&
-                   (float_pos2 + TOLERANCE > attach_pos2));
-    }
-
-  child = gtk_bin_get_child (GTK_BIN (hb));
-
-  if (is_snapped)
-    {
-      if (priv->child_detached)
-       {
-         priv->child_detached = FALSE;
-         gdk_window_hide (priv->float_window);
-         gdk_window_reparent (priv->bin_window, gtk_widget_get_window (widget), 0, 0);
-         priv->float_window_mapped = FALSE;
-         g_signal_emit (hb,
-                        handle_box_signals[SIGNAL_CHILD_ATTACHED],
-                        0,
-                        child);
-         
-         gtk_widget_queue_resize (widget);
-       }
-    }
-  else
-    {
-      gint width, height;
-
-      width = gdk_window_get_width (priv->float_window);
-      height = gdk_window_get_height (priv->float_window);
-
-      switch (handle_position)
-       {
-       case GTK_POS_LEFT:
-         new_y += ((gint)priv->float_allocation.height - height) / 2;
-         break;
-       case GTK_POS_RIGHT:
-         new_x += (gint)priv->float_allocation.width - width;
-         new_y += ((gint)priv->float_allocation.height - height) / 2;
-         break;
-       case GTK_POS_TOP:
-         new_x += ((gint)priv->float_allocation.width - width) / 2;
-         break;
-       case GTK_POS_BOTTOM:
-         new_x += ((gint)priv->float_allocation.width - width) / 2;
-         new_y += (gint)priv->float_allocation.height - height;
-         break;
-       }
-
-      if (priv->child_detached)
-       {
-         gdk_window_move (priv->float_window, new_x, new_y);
-         gdk_window_raise (priv->float_window);
-       }
-      else
-       {
-          guint border_width;
-         GtkRequisition child_requisition;
-
-         priv->child_detached = TRUE;
-
-         if (child)
-            {
-              gtk_widget_get_preferred_size (child, &child_requisition, NULL);
-            }
-         else
-           {
-             child_requisition.width = 0;
-             child_requisition.height = 0;
-           }      
-
-          border_width = gtk_container_get_border_width (GTK_CONTAINER (hb));
-         width = child_requisition.width + 2 * border_width;
-         height = child_requisition.height + 2 * border_width;
-
-         if (handle_position == GTK_POS_LEFT || handle_position == GTK_POS_RIGHT)
-           width += DRAG_HANDLE_SIZE;
-         else
-           height += DRAG_HANDLE_SIZE;
-         
-         gdk_window_move_resize (priv->float_window, new_x, new_y, width, height);
-         gdk_window_reparent (priv->bin_window, priv->float_window, 0, 0);
-         gdk_window_set_geometry_hints (priv->float_window, &geometry, GDK_HINT_POS);
-         gdk_window_show (priv->float_window);
-         priv->float_window_mapped = TRUE;
-#if    0
-         /* this extra move is necessary if we use decorations, or our
-          * window manager insists on decorations.
-          */
-         gdk_display_sync (gtk_widget_get_display (widget));
-         gdk_window_move (priv->float_window, new_x, new_y);
-         gdk_display_sync (gtk_widget_get_display (widget));
-#endif /* 0 */
-         g_signal_emit (hb,
-                        handle_box_signals[SIGNAL_CHILD_DETACHED],
-                        0,
-                        child);
-         
-         gtk_widget_queue_resize (widget);
-       }
-    }
-
-  return TRUE;
-}
-
-static void
-gtk_handle_box_add (GtkContainer *container,
-                   GtkWidget    *widget)
-{
-  GtkHandleBoxPrivate *priv = GTK_HANDLE_BOX (container)->priv;
-
-  gtk_widget_set_parent_window (widget, priv->bin_window);
-  GTK_CONTAINER_CLASS (gtk_handle_box_parent_class)->add (container, widget);
-}
-
-static void
-gtk_handle_box_remove (GtkContainer *container,
-                      GtkWidget    *widget)
-{
-  GTK_CONTAINER_CLASS (gtk_handle_box_parent_class)->remove (container, widget);
-
-  gtk_handle_box_reattach (GTK_HANDLE_BOX (container));
-}
-
-static gint
-gtk_handle_box_delete_event (GtkWidget *widget,
-                            GdkEventAny  *event)
-{
-  GtkHandleBox *hb = GTK_HANDLE_BOX (widget);
-  GtkHandleBoxPrivate *priv = hb->priv;
-
-  if (event->window == priv->float_window)
-    {
-      gtk_handle_box_reattach (hb);
-      
-      return TRUE;
-    }
-
-  return FALSE;
-}
-
-static void
-gtk_handle_box_reattach (GtkHandleBox *hb)
-{
-  GtkHandleBoxPrivate *priv = hb->priv;
-  GtkWidget *child;
-  GtkWidget *widget = GTK_WIDGET (hb);
-  
-  if (priv->child_detached)
-    {
-      priv->child_detached = FALSE;
-      if (gtk_widget_get_realized (widget))
-       {
-         gdk_window_hide (priv->float_window);
-          gdk_window_reparent (priv->bin_window, gtk_widget_get_window (widget),
-                               0, 0);
-
-          child = gtk_bin_get_child (GTK_BIN (hb));
-         if (child)
-           g_signal_emit (hb,
-                          handle_box_signals[SIGNAL_CHILD_ATTACHED],
-                          0,
-                          child);
-
-       }
-      priv->float_window_mapped = FALSE;
-    }
-  if (priv->in_drag)
-    gtk_handle_box_end_drag (hb, GDK_CURRENT_TIME);
-
-  gtk_widget_queue_resize (GTK_WIDGET (hb));
-}
-
-static void
-gtk_handle_box_end_drag (GtkHandleBox *hb,
-                        guint32       time)
-{
-  GtkHandleBoxPrivate *priv = hb->priv;
-  GtkWidget *invisible = gtk_handle_box_get_invisible ();
-
-  priv->in_drag = FALSE;
-
-  gtk_device_grab_remove (invisible, priv->grab_device);
-  gdk_device_ungrab (priv->grab_device, time);
-  g_signal_handlers_disconnect_by_func (invisible,
-                                       G_CALLBACK (gtk_handle_box_grab_event),
-                                       hb);
-
-  priv->grab_device = NULL;
-}
diff --git a/gtk/deprecated/gtkhandlebox.h b/gtk/deprecated/gtkhandlebox.h
deleted file mode 100644 (file)
index b63476e..0000000
+++ /dev/null
@@ -1,111 +0,0 @@
-/* GTK - The GIMP Toolkit
- * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
- * Copyright (C) 1998 Elliot Lee
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-/*
- * Modified by the GTK+ Team and others 1997-2000.  See the AUTHORS
- * file for a list of people on the GTK+ Team.  See the ChangeLog
- * files for a list of changes.  These files are distributed with
- * GTK+ at ftp://ftp.gtk.org/pub/gtk/.
- */
-
-/* The GtkHandleBox is to allow widgets to be dragged in and out of
- * their parents.
- */
-
-#ifndef __GTK_HANDLE_BOX_H__
-#define __GTK_HANDLE_BOX_H__
-
-#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
-#error "Only <gtk/gtk.h> can be included directly."
-#endif
-
-#include <gtk/gtkbin.h>
-
-G_BEGIN_DECLS
-
-#define GTK_TYPE_HANDLE_BOX            (gtk_handle_box_get_type ())
-#define GTK_HANDLE_BOX(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_HANDLE_BOX, GtkHandleBox))
-#define GTK_HANDLE_BOX_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_HANDLE_BOX, GtkHandleBoxClass))
-#define GTK_IS_HANDLE_BOX(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_HANDLE_BOX))
-#define GTK_IS_HANDLE_BOX_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_HANDLE_BOX))
-#define GTK_HANDLE_BOX_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_HANDLE_BOX, GtkHandleBoxClass))
-
-typedef struct _GtkHandleBox              GtkHandleBox;
-typedef struct _GtkHandleBoxPrivate       GtkHandleBoxPrivate;
-typedef struct _GtkHandleBoxClass         GtkHandleBoxClass;
-
-struct _GtkHandleBox
-{
-  GtkBin bin;
-
-  /*< private >*/
-  GtkHandleBoxPrivate *priv;
-};
-
-/**
- * GtkHandleBoxClass:
- * @parent_class: The parent class.
- * @child_attached: Signal emitted when the contents of the handlebox
- *    are reattached to the main window. Deprecated: 3.4.
- * @child_detached: Signal emitted when the contents of the handlebox
- *    are detached from the main window. Deprecated: 3.4.
- */
-struct _GtkHandleBoxClass
-{
-  GtkBinClass parent_class;
-
-  void (*child_attached)       (GtkHandleBox   *handle_box,
-                                GtkWidget      *child);
-  void (*child_detached)       (GtkHandleBox   *handle_box,
-                                GtkWidget      *child);
-
-  /*< private >*/
-
-  /* Padding for future expansion */
-  void (*_gtk_reserved1) (void);
-  void (*_gtk_reserved2) (void);
-  void (*_gtk_reserved3) (void);
-  void (*_gtk_reserved4) (void);
-};
-
-
-GDK_DEPRECATED_IN_3_4
-GType         gtk_handle_box_get_type             (void) G_GNUC_CONST;
-GDK_DEPRECATED_IN_3_4
-GtkWidget*    gtk_handle_box_new                  (void);
-GDK_DEPRECATED_IN_3_4
-void          gtk_handle_box_set_shadow_type      (GtkHandleBox    *handle_box,
-                                                   GtkShadowType    type);
-GDK_DEPRECATED_IN_3_4
-GtkShadowType gtk_handle_box_get_shadow_type      (GtkHandleBox    *handle_box);
-GDK_DEPRECATED_IN_3_4
-void          gtk_handle_box_set_handle_position  (GtkHandleBox    *handle_box,
-                                                  GtkPositionType  position);
-GDK_DEPRECATED_IN_3_4
-GtkPositionType gtk_handle_box_get_handle_position(GtkHandleBox    *handle_box);
-GDK_DEPRECATED_IN_3_4
-void          gtk_handle_box_set_snap_edge        (GtkHandleBox    *handle_box,
-                                                  GtkPositionType  edge);
-GDK_DEPRECATED_IN_3_4
-GtkPositionType gtk_handle_box_get_snap_edge      (GtkHandleBox    *handle_box);
-GDK_DEPRECATED_IN_3_4
-gboolean      gtk_handle_box_get_child_detached   (GtkHandleBox    *handle_box);
-
-G_END_DECLS
-
-#endif /* __GTK_HANDLE_BOX_H__ */
index 8ad92f09abf1c311ca5a1437b117cb4a88ea590e..2cab744fff005ba358b4b86525170dd171efb499 100644 (file)
@@ -439,9 +439,8 @@ gtk_misc_realize (GtkWidget *widget)
       attributes.width = allocation.width;
       attributes.height = allocation.height;
       attributes.wclass = GDK_INPUT_OUTPUT;
-      attributes.visual = gtk_widget_get_visual (widget);
       attributes.event_mask = gtk_widget_get_events (widget);
-      attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+      attributes_mask = GDK_WA_X | GDK_WA_Y;
 
       window = gdk_window_new (gtk_widget_get_parent_window (widget), &attributes, attributes_mask);
       gtk_widget_set_window (widget, window);
index a8584540380a1e16c304e4fcd81c4e17fddb2287..7cc03bfc2f9297aef248837245b2ef6dce98b08a 100644 (file)
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
 #include <gtk/deprecated/gtkcolorseldialog.h>
 #include <gtk/deprecated/gtkfontsel.h>
 #include <gtk/deprecated/gtkgradient.h>
-#include <gtk/deprecated/gtkhandlebox.h>
 #include <gtk/deprecated/gtkhbbox.h>
 #include <gtk/deprecated/gtkhpaned.h>
 #include <gtk/deprecated/gtkhsv.h>
index e08907cd3aaca4f9e67bf6287b6574158358a629..b90cadca8450d3d43f8c4d0143a1acdccfd3e6ca 100644 (file)
@@ -1840,22 +1840,16 @@ gtk_drag_set_icon_widget_internal (GdkDragContext *context,
   if (!info->icon_window)
     {
       GdkScreen *screen;
-      GdkVisual *visual;
-      gboolean has_rgba;
 
       screen = gdk_window_get_screen (gdk_drag_context_get_source_window (context));
-      visual = gdk_screen_get_rgba_visual (screen);
-      has_rgba = visual != NULL && gdk_screen_is_composited (screen);
 
       info->icon_window = gtk_window_new (GTK_WINDOW_POPUP);
       gtk_window_set_type_hint (GTK_WINDOW (info->icon_window), GDK_WINDOW_TYPE_HINT_DND);
       gtk_window_set_screen (GTK_WINDOW (info->icon_window), screen);
       gtk_widget_set_size_request (info->icon_window, 24, 24);
-      if (visual)
-        gtk_widget_set_visual (info->icon_window, visual);
       gtk_widget_set_events (info->icon_window, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
 
-      if (has_rgba)
+      if (gdk_screen_is_composited (screen))
         gtk_widget_set_app_paintable (info->icon_window, TRUE);
 
       gtk_window_set_hardcoded_window (GTK_WINDOW (info->icon_window),
@@ -2077,8 +2071,6 @@ gtk_drag_set_icon_surface (GdkDragContext  *context,
   GdkScreen *screen;
   GdkRectangle extents;
   cairo_pattern_t *pattern;
-  GdkVisual *rgba_visual;
-  gboolean has_rgba;
   cairo_matrix_t matrix;
 
   g_return_if_fail (GDK_IS_DRAG_CONTEXT (context));
@@ -2087,16 +2079,11 @@ gtk_drag_set_icon_surface (GdkDragContext  *context,
   _gtk_cairo_surface_extents (surface, &extents);
 
   screen = gdk_window_get_screen (gdk_drag_context_get_source_window (context));
-  rgba_visual = gdk_screen_get_rgba_visual (screen);
 
   window = gtk_window_new (GTK_WINDOW_POPUP);
-  has_rgba = rgba_visual != NULL && gdk_screen_is_composited (screen);
 
   gtk_window_set_screen (GTK_WINDOW (window), screen);
 
-  if (has_rgba)
-    gtk_widget_set_visual (GTK_WIDGET (window), rgba_visual);
-
   gtk_window_set_type_hint (GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_DND);
 
   gtk_widget_set_events (window, GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK);
@@ -2111,8 +2098,8 @@ gtk_drag_set_icon_surface (GdkDragContext  *context,
 
   g_signal_connect_data (window,
                          "draw",
-                         has_rgba ? G_CALLBACK (gtk_drag_draw_icon_pattern)
-                                  : G_CALLBACK (gtk_drag_draw_icon_pattern_and_background),
+                         gdk_screen_is_composited (screen) ? G_CALLBACK (gtk_drag_draw_icon_pattern)
+                                                           : G_CALLBACK (gtk_drag_draw_icon_pattern_and_background),
                          pattern,
                          (GClosureNotify) cairo_pattern_destroy,
                          G_CONNECT_AFTER);
index 261bf344798121a25c4d6ed1d1c20febddc0a45b..16f8f3befdd39947591d7ba7d5f645fd4d20880e 100644 (file)
@@ -208,10 +208,9 @@ gtk_drawing_area_realize (GtkWidget *widget)
       attributes.width = allocation.width;
       attributes.height = allocation.height;
       attributes.wclass = GDK_INPUT_OUTPUT;
-      attributes.visual = gtk_widget_get_visual (widget);
       attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
 
-      attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+      attributes_mask = GDK_WA_X | GDK_WA_Y;
 
       window = gdk_window_new (gtk_widget_get_parent_window (widget),
                                &attributes, attributes_mask);
index 288b5fffb3c488abf009758c410d2e689efbdfc6..dc06847ac992e45249699bb29b6d1fa0ee5d7593 100644 (file)
@@ -418,10 +418,9 @@ gtk_event_box_realize (GtkWidget *widget)
   visible_window = gtk_widget_get_has_window (widget);
   if (visible_window)
     {
-      attributes.visual = gtk_widget_get_visual (widget);
       attributes.wclass = GDK_INPUT_OUTPUT;
 
-      attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+      attributes_mask = GDK_WA_X | GDK_WA_Y;
 
       window = gdk_window_new (gtk_widget_get_parent_window (widget),
                                &attributes, attributes_mask);
index 79d00cdfa62d7882b5e8007eef398e19a6470c15..097676d14ee6dac77817cdd22fa35e15713cd6b6 100644 (file)
@@ -393,11 +393,10 @@ gtk_fixed_realize (GtkWidget *widget)
       attributes.width = allocation.width;
       attributes.height = allocation.height;
       attributes.wclass = GDK_INPUT_OUTPUT;
-      attributes.visual = gtk_widget_get_visual (widget);
       attributes.event_mask = gtk_widget_get_events (widget);
       attributes.event_mask |= GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK;
 
-      attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+      attributes_mask = GDK_WA_X | GDK_WA_Y;
 
       window = gdk_window_new (gtk_widget_get_parent_window (widget),
                                &attributes, attributes_mask);
index 091c9a6bd2d958de262ac3e959ce35ff07a59bf1..54d89824a615ed40bd268be0563cb63f25927bca 100644 (file)
@@ -1314,10 +1314,9 @@ gtk_icon_view_realize (GtkWidget *widget)
   attributes.width = allocation.width;
   attributes.height = allocation.height;
   attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
index 26b74f29812c54033991f03bebefe877f871062c..7402651b26af7deacf53586a8c4bc66149025f45 100644 (file)
@@ -899,10 +899,9 @@ gtk_layout_realize (GtkWidget *widget)
   attributes.width = allocation.width;
   attributes.height = allocation.height;
   attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
index 3e10e760a80a59f4e8492306de52dc7ff4fb2311..0143b3b2af1c2def5e644c348b9489ff6f605f46 100644 (file)
@@ -2733,12 +2733,11 @@ gtk_menu_realize (GtkWidget *widget)
   attributes.width = allocation.width;
   attributes.height = allocation.height;
   attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.event_mask = gtk_widget_get_events (widget);
   attributes.event_mask |= (GDK_KEY_PRESS_MASK |
                             GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK );
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
index e15102ac326668497c9cecac3f35aa03dd15d86f..c284c6ad7b5597a3283bdabeb4de8287edfa06f2 100644 (file)
@@ -598,7 +598,6 @@ gtk_menu_shell_realize (GtkWidget *widget)
   attributes.height = allocation.height;
   attributes.window_type = GDK_WINDOW_CHILD;
   attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.event_mask = gtk_widget_get_events (widget);
   attributes.event_mask |= (GDK_BUTTON_PRESS_MASK |
                             GDK_BUTTON_RELEASE_MASK |
@@ -607,7 +606,7 @@ gtk_menu_shell_realize (GtkWidget *widget)
                             GDK_ENTER_NOTIFY_MASK |
                             GDK_LEAVE_NOTIFY_MASK);
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
index 29e5b315edba96fc9611ed64aed2f909bee47924..64509438ac3ef532fb0129f5b42770b181045dba 100644 (file)
@@ -2952,9 +2952,8 @@ show_drag_window (GtkNotebook        *notebook,
       attributes.height = allocation.height;
       attributes.window_type = GDK_WINDOW_CHILD;
       attributes.wclass = GDK_INPUT_OUTPUT;
-      attributes.visual = gtk_widget_get_visual (widget);
       attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK;
-      attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+      attributes_mask = GDK_WA_X | GDK_WA_Y;
 
       priv->drag_window = gdk_window_new (gtk_widget_get_parent_window (widget),
                                           &attributes,
index a07c7f67f28c953642c3b6b5646a4fd9c604f685..ec2594c7fbb2f371eb4cd224fa79862fcc9e2996 100644 (file)
@@ -175,10 +175,9 @@ gtk_offscreen_window_realize (GtkWidget *widget)
   attributes.height = allocation.height;
   attributes.window_type = GDK_WINDOW_OFFSCREEN;
   attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.wclass = GDK_INPUT_OUTPUT;
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
index 0af10a5c345b9fee6d55af70dc8073f72c84f3e7..29fc355cba4351bd1e5cb630b8f7d33b80026b31 100644 (file)
@@ -149,8 +149,7 @@ gtk_overlay_create_child_window (GtkOverlay *overlay,
   attributes.height = allocation.height;
   attributes.x = allocation.x;
   attributes.y = allocation.y;
-  attributes.visual = gtk_widget_get_visual (widget);
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
   attributes.event_mask = gtk_widget_get_events (widget);
 
   window = gdk_window_new (gtk_widget_get_window (widget),
index cbe65e9e7cc0c78d08694e071227f7e6fa2d882e..c6aafd2db0656ad8b898d19b568abce4b7c5da44 100644 (file)
@@ -1614,7 +1614,6 @@ gtk_paned_create_child_window (GtkPaned  *paned,
   attributes.window_type = GDK_WINDOW_CHILD;
   attributes.wclass = GDK_INPUT_OUTPUT;
   attributes.event_mask = gtk_widget_get_events (widget);
-  attributes.visual = gtk_widget_get_visual (widget);
   if (child)
     {
       GtkAllocation allocation;
@@ -1643,13 +1642,13 @@ gtk_paned_create_child_window (GtkPaned  *paned,
       gtk_widget_get_allocation (child, &allocation);
       attributes.width = allocation.width;
       attributes.height = allocation.height;
-      attributes_mask = GDK_WA_X | GDK_WA_Y| GDK_WA_VISUAL;
+      attributes_mask = GDK_WA_X | GDK_WA_Y;
     }
   else
     {
       attributes.width = 1;
       attributes.height = 1;
-      attributes_mask = GDK_WA_VISUAL;
+      attributes_mask = 0;
     }
 
   window = gdk_window_new (gtk_widget_get_window (widget),
index abfb90f0b27dc5cba14741a2d373bbf0df1d030d..55709312776c75b414410a349a316924a46e145f 100644 (file)
@@ -399,7 +399,6 @@ gtk_popover_realize (GtkWidget *widget)
   attributes.width = allocation.width;
   attributes.height = allocation.height;
   attributes.window_type = GDK_WINDOW_CHILD;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.wclass = GDK_INPUT_OUTPUT;
   attributes.event_mask =
     gtk_widget_get_events (widget) |
@@ -410,7 +409,7 @@ gtk_popover_realize (GtkWidget *widget)
     GDK_ENTER_NOTIFY_MASK |
     GDK_LEAVE_NOTIFY_MASK;
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
   gtk_widget_set_window (widget, window);
index b23f66a7e118420e610855142aad4809a6c4a58c..2e3d34fc6ba72fd7d8626ac0b2a70c5bc61cb016 100644 (file)
@@ -365,10 +365,9 @@ gtk_revealer_real_realize (GtkWidget *widget)
   attributes.height = allocation.height;
   attributes.window_type = GDK_WINDOW_CHILD;
   attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.event_mask =
     gtk_widget_get_events (widget);
-  attributes_mask = (GDK_WA_X | GDK_WA_Y) | GDK_WA_VISUAL;
+  attributes_mask = (GDK_WA_X | GDK_WA_Y);
 
   priv->view_window =
     gdk_window_new (gtk_widget_get_parent_window ((GtkWidget*) revealer),
index 3392475448a6c508d67e47880d62b2c68e9f5a4e..a44d4fa09126a1810262070afb6a62f3e1944156 100644 (file)
@@ -4170,8 +4170,7 @@ create_indicator_window (GtkScrolledWindow *scrolled_window,
   attributes.height = allocation.height;
   attributes.x = allocation.x;
   attributes.y = allocation.y;
-  attributes.visual = gtk_widget_get_visual (widget);
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
   attributes.event_mask = gtk_widget_get_events (widget);
 
   window = gdk_window_new (gtk_widget_get_window (widget),
@@ -4443,8 +4442,7 @@ gtk_scrolled_window_realize (GtkWidget *widget)
   attributes.height = allocation.height;
   attributes.x = allocation.x;
   attributes.y = allocation.y;
-  attributes.visual = gtk_widget_get_visual (widget);
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
   attributes.event_mask = gtk_widget_get_events (widget) |
     GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_MASK;
 
index 211143954b8768eb4d1b73db120c2f094545196b..228d90fb0aa2da8a3742f71ac41c76046514a687 100644 (file)
@@ -295,7 +295,6 @@ gtk_separator_tool_item_realize (GtkWidget *widget)
   attributes.width = allocation.width;
   attributes.height = allocation.height;
   attributes.wclass = GDK_INPUT_ONLY;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.event_mask = gtk_widget_get_events (widget) |
                           GDK_BUTTON_PRESS_MASK |
                           GDK_BUTTON_RELEASE_MASK |
index 9e5e4c7849483ee596ad318d1bbfcd97bed7389d..a3caec71be53d0bdd236de22d720e6fcb62ad621 100644 (file)
@@ -977,13 +977,12 @@ gtk_spin_button_realize (GtkWidget *widget)
 
   attributes.window_type = GDK_WINDOW_CHILD;
   attributes.wclass = GDK_INPUT_ONLY;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.event_mask = gtk_widget_get_events (widget);
   attributes.event_mask |= GDK_BUTTON_PRESS_MASK
     | GDK_BUTTON_RELEASE_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_ENTER_NOTIFY_MASK
     | GDK_POINTER_MOTION_MASK;
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   gtk_css_gadget_get_border_allocation (priv->up_button, &up_allocation, NULL);
   gtk_css_gadget_get_border_allocation (priv->down_button, &down_allocation, NULL);
index 22e19a6bfac0d6e1e99ca1248b313e0d7815a239..ca3e4e43e1b200d230c61f27f057f14e0028be84 100644 (file)
@@ -351,10 +351,9 @@ gtk_stack_realize (GtkWidget *widget)
   attributes.height = allocation.height;
   attributes.window_type = GDK_WINDOW_CHILD;
   attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.event_mask =
     gtk_widget_get_events (widget);
-  attributes_mask = (GDK_WA_X | GDK_WA_Y) | GDK_WA_VISUAL;
+  attributes_mask = (GDK_WA_X | GDK_WA_Y);
 
   priv->view_window =
     gdk_window_new (gtk_widget_get_window (GTK_WIDGET (stack)),
index 01b60e52451a8f21052f05cf906866c7759b493c..f6be78bfe838ef22054faf907ce746b847d76bc9 100644 (file)
@@ -4686,10 +4686,9 @@ gtk_text_view_realize (GtkWidget *widget)
   attributes.width = allocation.width;
   attributes.height = allocation.height;
   attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
@@ -9944,10 +9943,9 @@ text_window_realize (GtkTextWindow *win,
   attributes.width = win->allocation.width;
   attributes.height = win->allocation.height;
   attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (win->widget);
   attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gtk_widget_get_window (widget);
 
index c4dbbcbbe5066af4594656d43a283a1aff113cbe..38fedeb4d25d6ef9d5ec4fe3a27b7da75acdd0bb 100644 (file)
@@ -1255,12 +1255,11 @@ gtk_tool_item_group_realize (GtkWidget *widget)
   attributes.width = allocation.width - border_width * 2;
   attributes.height = allocation.height - border_width * 2;
   attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.event_mask = gtk_widget_get_events (widget)
                          | GDK_VISIBILITY_NOTIFY_MASK
                          | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
                          | GDK_BUTTON_MOTION_MASK;
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
index 83f8e489dee7026e69ff90ab759c65785f23ca38..a5258233c58ad052e0ffc078d055cb2645ed8dca 100644 (file)
@@ -730,14 +730,13 @@ gtk_tool_palette_realize (GtkWidget *widget)
   attributes.width = allocation.width - border_width * 2;
   attributes.height = allocation.height - border_width * 2;
   attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.event_mask = gtk_widget_get_events (widget)
                          | GDK_VISIBILITY_NOTIFY_MASK
                          | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK
                          | GDK_BUTTON_MOTION_MASK
                          | GDK_SCROLL_MASK | GDK_SMOOTH_SCROLL_MASK
                          | GDK_TOUCH_MASK;
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
index 73d355798e3ab1ad39207f2f423dd50a76c60ad3..fa82973ef90c49f3068f8cfdecfd65ff9985178d 100644 (file)
@@ -2434,10 +2434,9 @@ gtk_tree_view_realize (GtkWidget *widget)
   attributes.width = allocation.width;
   attributes.height = allocation.height;
   attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
@@ -4046,9 +4045,8 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view)
           gtk_widget_get_allocation (button, &drag_allocation);
          width = attributes.width = drag_allocation.width;
          height = attributes.height = drag_allocation.height;
-         attributes.visual = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget));
          attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK;
-         attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+         attributes_mask = GDK_WA_X | GDK_WA_Y;
          tree_view->priv->drag_highlight_window = gdk_window_new (tree_view->priv->header_window, &attributes, attributes_mask);
          gtk_widget_register_window (GTK_WIDGET (tree_view), tree_view->priv->drag_highlight_window);
 
@@ -4092,9 +4090,8 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view)
 
          attributes.window_type = GDK_WINDOW_TEMP;
          attributes.wclass = GDK_INPUT_OUTPUT;
-         attributes.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));
          attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK;
-         attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+         attributes_mask = GDK_WA_X | GDK_WA_Y;
           attributes.x = x;
           attributes.y = y;
          attributes.width = width;
@@ -4173,9 +4170,8 @@ gtk_tree_view_motion_draw_column_motion_arrow (GtkTreeView *tree_view)
 
          attributes.window_type = GDK_WINDOW_TEMP;
          attributes.wclass = GDK_INPUT_OUTPUT;
-         attributes.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));
          attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK;
-         attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+         attributes_mask = GDK_WA_X | GDK_WA_Y;
           attributes.x = x;
           attributes.y = y;
          attributes.width = width;
@@ -10068,9 +10064,8 @@ _gtk_tree_view_column_start_drag (GtkTreeView       *tree_view,
   attributes.y = 0;
   attributes.width = button_allocation.width;
   attributes.height = button_allocation.height;
-  attributes.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));
   attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK | GDK_POINTER_MOTION_MASK;
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   tree_view->priv->drag_window = gdk_window_new (tree_view->priv->header_window,
                                                  &attributes,
index fff7ce7ef66af54fda6c665b4dca27c6c9ac6cb1..e61e392073c335c48f53e1472e858b0e76867ead 100644 (file)
@@ -1329,7 +1329,6 @@ _gtk_tree_view_column_realize_button (GtkTreeViewColumn *column)
 
   attr.window_type = GDK_WINDOW_CHILD;
   attr.wclass = GDK_INPUT_ONLY;
-  attr.visual = gtk_widget_get_visual (GTK_WIDGET (tree_view));
   attr.event_mask = gtk_widget_get_events (GTK_WIDGET (tree_view)) |
                     (GDK_BUTTON_PRESS_MASK |
                     GDK_BUTTON_RELEASE_MASK |
index a5487ffc705f0ec5a5c8892a771641148ad811b4..1f7b4949e8af7fedbf86357a2ba6079285dd2524 100644 (file)
@@ -850,13 +850,12 @@ gtk_viewport_realize (GtkWidget *widget)
   attributes.height = allocation.height;
   attributes.window_type = GDK_WINDOW_CHILD;
   attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
 
   event_mask = gtk_widget_get_events (widget);
 
   attributes.event_mask = event_mask | GDK_SCROLL_MASK | GDK_TOUCH_MASK | GDK_SMOOTH_SCROLL_MASK;
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
index 932bea4484b79f9f0ab421a92615a1a67cd9dd45..d50a77c581e31508e7a33a430003b36ebcda9d30 100644 (file)
@@ -828,7 +828,6 @@ static GQuark               quark_pango_context = 0;
 static GQuark          quark_mnemonic_labels = 0;
 static GQuark          quark_tooltip_markup = 0;
 static GQuark          quark_tooltip_window = 0;
-static GQuark          quark_visual = 0;
 static GQuark           quark_modifier_style = 0;
 static GQuark           quark_enabled_devices = 0;
 static GQuark           quark_size_groups = 0;
@@ -997,7 +996,6 @@ gtk_widget_class_init (GtkWidgetClass *klass)
   quark_mnemonic_labels = g_quark_from_static_string ("gtk-mnemonic-labels");
   quark_tooltip_markup = g_quark_from_static_string ("gtk-tooltip-markup");
   quark_tooltip_window = g_quark_from_static_string ("gtk-tooltip-window");
-  quark_visual = g_quark_from_static_string ("gtk-widget-visual");
   quark_modifier_style = g_quark_from_static_string ("gtk-widget-modifier-style");
   quark_enabled_devices = g_quark_from_static_string ("gtk-widget-enabled-devices");
   quark_size_groups = g_quark_from_static_string ("gtk-widget-size-groups");
@@ -6990,9 +6988,7 @@ gtk_widget_draw_internal (GtkWidget *widget,
         }
 
       push_group =
-        widget->priv->alpha != 255 &&
-        (!_gtk_widget_is_toplevel (widget) ||
-         gtk_widget_get_visual (widget) == gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget)));
+        widget->priv->alpha != 255 && !_gtk_widget_is_toplevel (widget);
 
       if (push_group)
         cairo_push_group (cr);
@@ -11512,74 +11508,6 @@ gtk_widget_get_ancestor (GtkWidget *widget,
   return widget;
 }
 
-/**
- * gtk_widget_set_visual:
- * @widget: a #GtkWidget
- * @visual: (allow-none): visual to be used or %NULL to unset a previous one
- *
- * Sets the visual that should be used for by widget and its children for
- * creating #GdkWindows. The visual must be on the same #GdkScreen as
- * returned by gtk_widget_get_screen(), so handling the
- * #GtkWidget::screen-changed signal is necessary.
- *
- * Setting a new @visual will not cause @widget to recreate its windows,
- * so you should call this function before @widget is realized.
- **/
-void
-gtk_widget_set_visual (GtkWidget *widget,
-                       GdkVisual *visual)
-{
-  g_return_if_fail (GTK_IS_WIDGET (widget));
-  g_return_if_fail (visual == NULL || GDK_IS_VISUAL (visual));
-
-  if (visual)
-    g_return_if_fail (gtk_widget_get_screen (widget) == gdk_visual_get_screen (visual));
-
-  g_object_set_qdata_full (G_OBJECT (widget),
-                           quark_visual,
-                           visual ? g_object_ref (visual) : NULL,
-                           g_object_unref);
-}
-
-/**
- * gtk_widget_get_visual:
- * @widget: a #GtkWidget
- *
- * Gets the visual that will be used to render @widget.
- *
- * Returns: (transfer none): the visual for @widget
- **/
-GdkVisual*
-gtk_widget_get_visual (GtkWidget *widget)
-{
-  GtkWidget *w;
-  GdkVisual *visual;
-  GdkScreen *screen;
-
-  g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
-
-  if (!_gtk_widget_get_has_window (widget) &&
-      widget->priv->window)
-    return gdk_window_get_visual (widget->priv->window);
-
-  screen = gtk_widget_get_screen (widget);
-
-  for (w = widget; w != NULL; w = w->priv->parent)
-    {
-      visual = g_object_get_qdata (G_OBJECT (w), quark_visual);
-      if (visual)
-        {
-          if (gdk_visual_get_screen (visual) == screen)
-            return visual;
-
-          g_warning ("Ignoring visual set on widget '%s' that is not on the correct screen.",
-                     gtk_widget_get_name (widget));
-        }
-    }
-
-  return gdk_screen_get_system_visual (screen);
-}
-
 /**
  * gtk_widget_get_settings:
  * @widget: a #GtkWidget
@@ -15959,8 +15887,7 @@ gtk_widget_update_alpha (GtkWidget *widget)
 
   if (_gtk_widget_get_realized (widget))
     {
-      if (_gtk_widget_is_toplevel (widget) &&
-          gtk_widget_get_visual (widget) != gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget)))
+      if (_gtk_widget_is_toplevel (widget))
        gdk_window_set_opacity (priv->window, priv->alpha / 255.0);
 
       gtk_widget_queue_draw (widget);
index aacfc94bb0abc2a9b88bd9126eb6213a37d88cb4..65a832d85850e9eaa1c104a2855c40c51de46890 100644 (file)
@@ -998,11 +998,6 @@ GtkWidget*   gtk_widget_get_toplevel       (GtkWidget      *widget);
 GDK_AVAILABLE_IN_ALL
 GtkWidget*   gtk_widget_get_ancestor   (GtkWidget      *widget,
                                         GType           widget_type);
-GDK_AVAILABLE_IN_ALL
-GdkVisual*   gtk_widget_get_visual     (GtkWidget      *widget);
-GDK_AVAILABLE_IN_ALL
-void         gtk_widget_set_visual     (GtkWidget      *widget,
-                                         GdkVisual      *visual);
 
 GDK_AVAILABLE_IN_ALL
 GdkScreen *   gtk_widget_get_screen      (GtkWidget *widget);
index 600951b3aa51580de973e1c0d95cc45bd55ab75c..a943b4ac5d1cfb6db80c494c8ff7ca5c01b91f9e 100644 (file)
@@ -4017,15 +4017,10 @@ gtk_window_enable_csd (GtkWindow *window)
 {
   GtkWindowPrivate *priv = window->priv;
   GtkWidget *widget = GTK_WIDGET (window);
-  GdkVisual *visual;
 
   /* We need a visual with alpha for client shadows */
   if (priv->use_client_shadow)
     {
-      visual = gdk_screen_get_rgba_visual (gtk_widget_get_screen (widget));
-      if (visual != NULL)
-        gtk_widget_set_visual (widget, visual);
-
       gtk_style_context_add_class (gtk_widget_get_style_context (widget), GTK_STYLE_CLASS_CSD);
     }
   else
@@ -6483,10 +6478,9 @@ popover_realize (GtkWidget        *widget,
   attributes.y = rect.y;
   attributes.width = rect.width;
   attributes.height = rect.height;
-  attributes.visual = gtk_widget_get_visual (GTK_WIDGET (window));
   attributes.event_mask = gtk_widget_get_events (popover->widget) |
     GDK_EXPOSURE_MASK;
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   popover->window = gdk_window_new (parent_window, &attributes, attributes_mask);
   gtk_widget_register_window (GTK_WIDGET (window), popover->window);
@@ -7005,10 +6999,9 @@ gtk_window_realize (GtkWidget *widget)
 
       attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK;
 
-      attributes.visual = gtk_widget_get_visual (widget);
       attributes.wclass = GDK_INPUT_OUTPUT;
 
-      attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+      attributes_mask = GDK_WA_X | GDK_WA_Y;
 
       gdk_window = gdk_window_new (gtk_widget_get_parent_window (widget),
                                   &attributes, attributes_mask);
@@ -7080,7 +7073,6 @@ gtk_window_realize (GtkWidget *widget)
 
       attributes.title = priv->title;
       attributes.wclass = GDK_INPUT_OUTPUT;
-      attributes.visual = gtk_widget_get_visual (widget);
 
       attributes_mask = 0;
       parent_window = gdk_screen_get_root_window (_gtk_window_get_screen (window));
@@ -7105,7 +7097,7 @@ gtk_window_realize (GtkWidget *widget)
 
       attributes.type_hint = priv->type_hint;
 
-      attributes_mask |= GDK_WA_VISUAL | GDK_WA_TYPE_HINT;
+      attributes_mask |= GDK_WA_TYPE_HINT;
       attributes_mask |= (priv->title ? GDK_WA_TITLE : 0);
 
       gdk_window = gdk_window_new (parent_window, &attributes, attributes_mask);
@@ -7123,10 +7115,9 @@ gtk_window_realize (GtkWidget *widget)
 
   attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK | GDK_STRUCTURE_MASK;
 
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.wclass = GDK_INPUT_OUTPUT;
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   if (priv->client_decorated && priv->type == GTK_WINDOW_TOPLEVEL)
     {
@@ -10595,7 +10586,6 @@ gtk_window_set_screen (GtkWindow *window,
   GtkWindowPrivate *priv;
   GtkWidget *widget;
   GdkScreen *previous_screen;
-  gboolean was_rgba;
   gboolean was_mapped;
 
   g_return_if_fail (GTK_IS_WINDOW (window));
@@ -10613,11 +10603,6 @@ gtk_window_set_screen (GtkWindow *window,
 
   previous_screen = priv->screen;
 
-  if (gdk_screen_get_rgba_visual (previous_screen) == gtk_widget_get_visual (widget))
-    was_rgba = TRUE;
-  else
-    was_rgba = FALSE;
-
   was_mapped = _gtk_widget_get_mapped (widget);
 
   if (was_mapped)
@@ -10651,15 +10636,6 @@ gtk_window_set_screen (GtkWindow *window,
     }
   g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_SCREEN]);
 
-  if (was_rgba && priv->use_client_shadow)
-    {
-      GdkVisual *visual;
-
-      visual = gdk_screen_get_rgba_visual (screen);
-      if (visual)
-        gtk_widget_set_visual (widget, visual);
-    }
-
   if (was_mapped)
     gtk_widget_map (widget);
 
index 3a1eb0381588a764badb1419aa751ea0daecc436..e8c55909fef62c535d08c763a884a8821f87a797 100644 (file)
@@ -278,8 +278,7 @@ deemphasize_window (GtkWidget *window)
   GdkScreen *screen;
 
   screen = gtk_widget_get_screen (window);
-  if (gdk_screen_is_composited (screen) &&
-      gtk_widget_get_visual (window) == gdk_screen_get_rgba_visual (screen))
+  if (gdk_screen_is_composited (screen))
     {
       cairo_rectangle_int_t rect;
       cairo_region_t *region;
@@ -300,8 +299,7 @@ reemphasize_window (GtkWidget *window)
   GdkScreen *screen;
 
   screen = gtk_widget_get_screen (window);
-  if (gdk_screen_is_composited (screen) &&
-      gtk_widget_get_visual (window) == gdk_screen_get_rgba_visual (screen))
+  if (gdk_screen_is_composited (screen))
     {
       gtk_widget_set_opacity (window, 1.0);
       gtk_widget_input_shape_combine_region (window, NULL);
index 5f474ace7f72769f33e59600367651bd371dd9f8..610ddd850c410a30a9567861dffa48553ca39f8f 100644 (file)
@@ -279,10 +279,9 @@ gtk_offscreen_box_realize (GtkWidget *widget)
                        | GDK_ENTER_NOTIFY_MASK
                        | GDK_LEAVE_NOTIFY_MASK;
 
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.wclass = GDK_INPUT_OUTPUT;
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
index 9f8f9c41ea9cb88a0b27e3f554f143bc81a61241..ce467ea46c69494e1741258b9113d924a25b9952 100644 (file)
@@ -52,10 +52,9 @@ da_realize (GtkWidget *widget)
   attributes.width = allocation.width;
   attributes.height = allocation.height;
   attributes.wclass = GDK_INPUT_OUTPUT;
-  attributes.visual = gtk_widget_get_visual (widget);
   attributes.event_mask = gtk_widget_get_events (widget) | GDK_EXPOSURE_MASK;
 
-  attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL;
+  attributes_mask = GDK_WA_X | GDK_WA_Y;
 
   window = gdk_window_new (gtk_widget_get_parent_window (widget),
                            &attributes, attributes_mask);
index 9b8149a4a50a9c4a5594a2f884a25a43cd59adcd..7becaae833e34787e1213df21b37be753e6a1abf 100644 (file)
@@ -226,27 +226,6 @@ build_alpha_widgets (void)
   return grid;
 }
 
-static void
-on_alpha_screen_changed (GtkWindow *window,
-                        GdkScreen *old_screen,
-                        GtkWidget *label)
-{
-  GdkScreen *screen = gtk_widget_get_screen (GTK_WIDGET (window));
-  GdkVisual *visual = gdk_screen_get_rgba_visual (screen);
-
-  if (!visual)
-    {
-      visual = gdk_screen_get_system_visual (screen);
-      gtk_label_set_markup (GTK_LABEL (label), "<b>Screen doesn't support alpha</b>");
-    }
-  else
-    {
-      gtk_label_set_markup (GTK_LABEL (label), "<b>Screen supports alpha</b>");
-    }
-
-  gtk_widget_set_visual (GTK_WIDGET (window), visual);
-}
-
 static void
 on_composited_changed (GtkWidget *window,
                      GtkLabel *label)
@@ -288,9 +267,6 @@ create_alpha_window (GtkWidget *widget)
 
       label = gtk_label_new (NULL);
       gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
-      on_alpha_screen_changed (GTK_WINDOW (window), NULL, label);
-      g_signal_connect (window, "screen-changed",
-                       G_CALLBACK (on_alpha_screen_changed), label);
       
       label = gtk_label_new (NULL);
       gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
@@ -366,10 +342,9 @@ create_pattern (GtkWidget   *widget,
              attributes.height = h;
              attributes.wclass = GDK_INPUT_OUTPUT;
              attributes.event_mask = GDK_EXPOSURE_MASK;
-             attributes.visual = gtk_widget_get_visual (widget);
              
              child = gdk_window_new (parent, &attributes,
-                                     GDK_WA_X | GDK_WA_Y | GDK_WA_VISUAL);
+                                     GDK_WA_X | GDK_WA_Y);
 
              pattern_set_bg (widget, child, level);